Re: drawing problems Property Page
From your code snippet Code snippet it does not look like your app is Win32 application.
Where is this code residing? If this is in a handler of the parent window, that is your problem.
Besides, your code creates GDI resources leaks. GetDC requires ReleaseDC. Allocating CDC object on the heap without releasing, creates memory leaks. Both happen each time that piece of code is executed.
I am not sure why do you want to use a static control with gray frame and change control’s color.
You would be better off by creating regular static control and handle WM_CTLCOLOR or WM_CTLCOLORSTATIC message in the parent window.
If this approach is not feasible, derive own class from CStatic subclass control you need to handle differently and handle WM_PAINT in derived class.
There are only 10 types of people in the world:
Those who understand binary and those who do not.