Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3029

Is there any way to change the background color of a messagebox?

$
0
0
Here is what I did,
Code:

oldHook = ::SetWindowsHookEx(WH_CALLWNDPROCRET, CallWndRetProc, NULL, ::GetCurrentThreadId());

MessageBox(...);

UnhookWindowsHookEx(oldHook);

Then within the callback function CallWndRetProc, I tried to change the background color of the dialog,
Code:

PAINTSTRUCT ps;
HDC hdc = BeginPaint(msg->hwnd, &ps);

::SetBkColor(hdc, RGB(255, 0, 0));

EndPaint(msg->hwnd, &ps);

But it doesn't change the background color of the dialog. I wonder what is the right way to do that? Thanks.

Viewing all articles
Browse latest Browse all 3029

Latest Images

Trending Articles



Latest Images