|
-
Jul 1st, 2002, 12:21 AM
#1
Thread Starter
Lively Member
Changing background color...
I'm using all dialog templates for my windows..... Is there any way to set background colors at design time?
And at runtime... is there anything else besides SetBKColor ?
-
Jul 1st, 2002, 04:12 AM
#2
PowerPoster
how about this?
PHP Code:
HBRUSH hBrush1=NULL;
LRESULT CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
// Create a red color solid brush for the dialouge use
hBrush1 = CreateSolidBrush(RGB(255, 0, 0));
return true;
case WM_CTLCOLORDLG:
// Change the dialog box background color
// Ref.
// wParam - handle to DC (HDC)
// lParam - handle to dialog box (HWND)
// Return the new craeted brush
return (long)hBrush1;
case WM_CLOSE:
case WM_DESTROY:
// Destroy the created brush
DeleteObject(hBrush1);
//
PostQuitMessage(0);
break;
}
return 0;
}
-
Jul 10th, 2002, 06:58 PM
#3
it should be
static HBRUSH...
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|