|
I am having a problem with a rich edit control not redrawing the frame
(border) properly when created over the top of a tab control. If the scroll
bar is shown and I delete all the text the scrollbar is removed and, for
some reason, so is the frame. Also the frame disappears if I minimise the
application and then restore it (no maximise option available). Has anybody
had any experience of this or a similar problem?
AxisFirst For Business
|
|
|
|
|
i have a toolbar made with the Win32 API
<br />
hwndTB = CreateWindowEx( 0, TOOLBARCLASSNAME, NULL, WS_CHILD | TBSTYLE_TOOLTIPS| WS_VISIBLE, <br />
0, 0, 0, 0, hWnd, (HMENU)IDC_TOOLBAR, GetModuleHandle(NULL), NULL );<br />
SendMessage( hwndTB, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0 );<br />
<br />
<br />
HBITMAP hBMP = LoadBitmap( GetModuleHandle(NULL), (LPCTSTR)IDB_TBBUTTONS );<br />
TBADDBITMAP tbab = {NULL,(int)hBMP};<br />
SendMessage( hwndTB, TB_SETBITMAPSIZE, 0, (LPARAM)MAKELONG(16,16) );<br />
SendMessage( hwndTB, TB_ADDBITMAP, 8, (LPARAM)&tbab );<br />
<br />
<br />
TBBUTTON tbb[] = { <br />
{0,IDM_FILE_ADD,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0,0},<br />
{1,IDM_FILE_EDIT,TBSTATE_ENABLED,TBSTYLE_BUTTON,1,1,1},<br />
{2,IDM_FILE_DELETE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,2,2},<br />
{0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0,0},<br />
{3,IDM_STUB_EDIT,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0,3},<br />
{5,IDM_FILE_BUILD,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0,4},<br />
{0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0,0},<br />
{4,IDM_HELP_README,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0,5}<br />
}; <br />
SendMessage( hwndTB, TB_ADDBUTTONS, 8, (LPARAM)&tbb );<br />
ShowWindow( hwndTB, SW_SHOW );
the bitmap(IDB_TBBUTTONS) looks like this
http://img422.imageshack.us/my.php?image=toolbarbuttons6gj.png[^]
so far it's working perfect, except i can't figure out how to set the mask, so the pink areas, are transparent..
can anyone help me out here?
|
|
|
|
|
I have not tried your code, but I find that the default generally helps:
The default background color of the toolbar created in VC applications have back color = RGB(192,192,192) Gray.
Try flood-filling the background of the toolbar with this color).
You can also use ImageLists. It seems to give the option of background masks.
this is this.
|
|
|
|
|
Hey,
I have a program that lists processes running on the system. For each Process I can get the Thread IDs of all the threads running in that process... Is it possible for me to use the thread ID for some process X to get that threads Module Name (like a loaded dll it uses) and/or Base address of the execution of that thread ?? Any help here would be appreciated.
Thanks,
Abhishek
|
|
|
|
|
Hi,
You need to use ToolHelp stuff.
See:
MODULENTRY32
Module32First
Module32Next
IMAGE_DOS_HEADER
IMAGE_NT_HEADER
ToolHelp32ReadProcessMemory
--
======
Arman
|
|
|
|
|
Hey Arman,
thanks for your reply... I have been using Thread32 and Process32 functions....how different would those be from Module32 .... What information must I give the module ?
Abhishek
|
|
|
|
|
Hey,
I had a look at the Module Function.....it gives me a list of the Modules that are being used by the process.....More specifically I need to find the start address of where a thread begins execution.
So I have a list of Threads .... how do I know the baseAddress of where they begin execution.
I don't know if you've used process explorer....When you right click on a process in Process Explorer and select properties, it pops up a tabbed window........Clicking on "Threads " in that window we get
a listing of Threads for the process in the form of Module!function....which basically gives the "Thread Start Address" and module name.
Regards ,
Abhishek
|
|
|
|
|
Have you checked the www.sysinternals.com website? I know they have process explorer there, not sure if they have source code for it or not.
.............................
There's nothing like the sound of incoming rifle and mortar rounds to cure the blues. No matter how down you are, you take an active and immediate interest in life.
Fiat justitia, et ruat cælum
|
|
|
|
|
hey,
I don't think sysinternals has the code for ProcessExplorer.......
Thanks
|
|
|
|
|
Hello,
I am having problem in passing pointers.
Here is a function:
static ULONG LoadParameter(lpInterface)
I need to pass this lpInterface pointer to another interface pointer called PDHINTERFACE(It has 4 parameters : ThreadID, input, output, size)
Thanks in advance
|
|
|
|
|
Exactly what is the problem?
Please post specific question.
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|
|
Okay, so i have this CPropertySheet with multiple CPropertyPages. It gets data from a socket, that is sent up the line on a timing basis. Im having trouble taking this data, and displaying them into a CEdit display. The problem being, when i first execute my application, the current page that it starts out on is fine to update the display fields, but i get into trouble trying to update fields that arent on the active page. I've noticed, if i go real quick and click the tabs, it works fine there-after. So my question is this, Is there a method in either CPropertyPages or CPropertySheet, that will allow me to initialize all the dialog items? Or is there a way to code the clicking of each tab( which i feel is a poor way to handle this problem, but if it works so be it. ) I've thought of just having some global structures that the once i get the data from the socket, save it to the structure, set some update needed flag, and only check the update flags depending on which page im on, but this seems like alot work for a potentially easy solution ( which cant be that easy, cause i've spent some time on this. ) I appriciate any advice you might have, weather opinion or answer, thanks.
-Jader89
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
Another Note, I using the .construct() to create the pages, and adding them using addPage(). Then calling the doModal() method.
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
you can initialize each page when it comes active with CPropertyPage::OnSetActive, if you can initialize the pages when they get created in each page's OnInitDialog.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
When you decalre the pages before adding them to the porpertysheet set the PSP_PREMATURE flag on its flags. This will cause the sheet to create all the pages at the time it opens for the first time.
This should do exactly what you need
If you vote me down, my score will only get lower
|
|
|
|
|
Excatly what i was looking for, thanks a million!
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
|
Hello,
I have a CWnd-derived class that owns several standard MFC controls (CEdit, CTreeCtrl, etc.) When the user hits the ENTER key, I want the main window to handle the message, regardless of what child has the focus.
What's the best way to do this? My current solution is to sub-class each child control and send a message to the parent when the ENTER key is pressed.
I'm hoping there's a better solution.
Any ideas?
Thanks!
-Ian
|
|
|
|
|
You could use the PreTranslateMessage() function of the app's class.
SkyWalker
|
|
|
|
|
Thanks! I'll give that a shot!
-Ian
|
|
|
|
|
Hi,
I've got a C++ based app that I'm using GDI+ to render with. I'm creating an offscreen graphics object and drawing text into it. Then I later blit that to the screen. However, that text is thicker in the offscreen than normal text onscreen when clear type is on (WinXP). How do I detect if cleartype is turned on?
I found references to GetGraphicsCaps but can't find any documentation on this method and can't use it. I figure I must be missing some SDK.
I assume that if I find that ClearType is on, I should then use Graphics::SetTextRenderingHint with TextRenderingHintClearTypeGridFit to turn it on in my offscreen graphics object.
Can anyone tell me how to tell if ClearType is on?
Thanks,
-Mike
|
|
|
|
|
ClearType is a mechanism for drawing on the screen that takes advantage of the ability to address at the sub-pixel level on color LCD screens.
In the Display control panel applet, there is a general switch to enable ClearType for all applications using TrueType fonts. Applications can detect the state of this global bit using SystemParametersInfo() with the SPI_GETFONTSMOOTHING flag. If font smoothing is enabled, you can query the type of smoothing used with a call to SystemParamtersInfo() using the SPI_GETFONTSMOOTHINGTYPE parameter. The call will return FE_FONTSMOOTHINGSTANDARD if standard anti-aliasing is used and FE_FONTSMOOTHINGCLEARTYPE if ClearType smoothing is enabled.
These parameters can be programmatically changed with the complementary commands to SystemParametersInfo() , SPI_SETFONTSMOOTHING and SPI_SETFONTSMOOTHINGTYPE.
SkyWalker
-- modified at 3:47 Saturday 15th October, 2005
|
|
|
|
|
I have a dialog box full of static text and edit controls that I populate with CStrings. Works great when I call DoModal(), but if I try to make it modless and use Create(IDD_DIALOG_ID) and ShowWindow(SH_SHOW) the dialog box is displayed but none of the static text or controls appear. How do I get the "guts" of the dialog box to be displayed also?
Buck
|
|
|
|
|
What does the OnInitDialog() method look like?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
It was just the default OnInitDialog(). I moved the ShowWindow(SW_SHOW) function into the OnInitDialog() and the static text of the dialog box is now displayed, but the read only edit controls were not. I added the UpdateData() function to no avail but then realized to add the UpdateWindow() function and now it's working the way I want. Sorry, but I'm not a Windows programmer so everthing seems to be a little backwards, including were to put my code to execute the logic my brain is thinking of. Too many years of structured procedural programming. Thanks a lot that saved me an entire days worth of time.
Much appreciation,
Buck
|
|
|
|
|