|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Rafael Heitor Correia de Melo
|
May 25, 2004 - 9:36 AM
|
I want to modify the current background color of the Prof-UIS interfaces that corresponds actually with the colors of windows configurations. I need to change this colors manually. Can you help me with this ? Exist any function with this funcionality or where I have to codify this modifications ? Thanks in advance, Rafael Melo
|
|
Technical Support
|
May 26, 2004 - 2:02 AM
|
Dear Rafael,
What do you mean exactly by "the background color of the Prof-UIS interfaces"? In case of the dialog background, you should use your own dialog class derived from CExtResizableDialog . The background color will correspond to the current theme. If you want to use a custom background color ( e.g., white), override the standard WindowProc() virtual method in a way like this:LRESULT CMyDialog::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if( message == WM_PAINT ||
message == WM_ERASEBKGND ||
( message >= WM_CTLCOLORMSGBOX && message <= WM_CTLCOLORSTATIC ) )
{
return CDialog::WindowProc(message,wParam,lParam);
}
return CExtResizableDialog::WindowProc(message,wParam,lParam);
} Then add the OnCtlColor() method to handle the WM_CTLCOLOR message and return a white brush in it (e.g., by calling ::GetStockObject(WHITE_BRUSH) ):HBRUSH CMyDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
return (HBRUSH)::GetStockObject(WHITE_BRUSH);
} The other way is to create your own paint manager and use any colors you want. The Prof-UIS paint manager modifies the Windows system colors. The modified colors depend on the current theme. So, just override the GetColor() method and replace some colors with your own. The new paint manager should be loaded in this way: g_PaintManager.InstallPaintManager(
new CYourPaintManager
);
|
|