Let me show the issue,
Use VC++'s wizard to create a skatlon win32 program (GUI), it will have a 'about' dialog box, when you click Help/About... , that dialog box will popup. it is OK after you compile the skatlon program and run it.
Now, I change the code in WndProc from:
--------------------------------------------------
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...
EndPaint(hWnd, &ps);
break;
---------------------------------------------------
To
---------------------------------------------------
case WM_PAINT:
break;
----------------------------------------------------
That means I will do nothing in WM_PAINT msg, even not pass-though to DefWindowProc. I know this is not recommand by document, but it is reasonable. Now, the issue comes up, after compile and run the program, click Help/About..., the about dialog box doesn't show but the main window is disabled.
I traced the code, it seems like that about dialog box didn't get its first WM_PAINT msg. that means DialogBox function(whatever MACRO) didnot call UpdateWindow after the ShowWindow. Maybe somebody will say: you should validate the main window. Yes, but a model dialog box (about, even MessageBox) should always be displayed no matter the main window re-painted. This really like a bug.
That's it.
Regards,
Nian