CStatic on CMDIChildWnd
-
-
Hello, I have a CStatic on CMDIChildWnd but I am not able to change its background color. I have tried using CWnd functions CStatic* Static = new CStatic; CDC* pDC = Static->GetDC(); pDC->SetBkMode(OPAQUE); pDC->SetBkColor(RGB(150,150,255)); Pritha
First of all, in your piece of code you have instantiated a CStatic object but have not created a static control (see CStatic::Create). And BTW: where/why do you want to put a static control in the MDI child frame window?
Ovidiu Cucu Microsoft MVP - Visual C++ Cofounder CODEXPERT.RO
-
Hello, I have a CStatic on CMDIChildWnd but I am not able to change its background color. I have tried using CWnd functions CStatic* Static = new CStatic; CDC* pDC = Static->GetDC(); pDC->SetBkMode(OPAQUE); pDC->SetBkColor(RGB(150,150,255)); Pritha
Handle the
WM_CTLCOLORSTATIC
notification and return the brush to be used to paint the control.«_Superman_» I love work. It gives me something to do between weekends.
-
First of all, in your piece of code you have instantiated a CStatic object but have not created a static control (see CStatic::Create). And BTW: where/why do you want to put a static control in the MDI child frame window?
Ovidiu Cucu Microsoft MVP - Visual C++ Cofounder CODEXPERT.RO
-
thanks Yes I do have the Create function. How do I use WM_CTLCOLORSTATIC ? Should I call the OnCtlColor() ? Thanks Pritha
No. It will be called by the system while initializing the controls. You simply have to return the appropriate brush from the message handler.
«_Superman_» I love work. It gives me something to do between weekends.
-
thanks Yes I do have the Create function. How do I use WM_CTLCOLORSTATIC ? Should I call the OnCtlColor() ? Thanks Pritha
You need to declare this event.
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )
-
You need to declare this event.
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )
-
Hello, There was a query on the same lines.I am many a times confused which are the fucntions that are called by the system automatically which are not. Now in this case why the creation of CStatic calls OnCtlColor(). Thanks, Pritha
Again you dont need to call OnCtlColor.
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )
-
Again you dont need to call OnCtlColor.
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )
-
Hello, I wanted to understand the functions that are directly called by the system and the reason behind it. Prithaa
We suppose you made a program Windows send messges to your program if you need to these messages you can declare events for them like WM_MOUSE* or WM_PAINT and etc.You dont need to call windows events because windows sends them to your program for exmaple you need to change color of a static control so you tell to Windows that I need to this event with declare this event.
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )
-
We suppose you made a program Windows send messges to your program if you need to these messages you can declare events for them like WM_MOUSE* or WM_PAINT and etc.You dont need to call windows events because windows sends them to your program for exmaple you need to change color of a static control so you tell to Windows that I need to this event with declare this event.
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )
-
Hello, Thanks for the reply. but how do I know exactly which functions are called by the system an which ones I am suppose to call. is there any article which makes this clear. Prithaa
You can see them on the MSDN for example if you enter WM_COPYDATA on the MSDN you will be see "This message is sent when an application passes data to another application" or WM_INPUT "The WM_INPUT message is sent to the window that is getting raw input."
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )