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;
}




Reply With Quote