关于GetMessage的问题
/* 这样的代码可以正常退出 */
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
/* 这样的代码窗口被销毁,当程序并未被结束 */
while (GetMessage (&msg, hwnd, 0, 0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
求解?
[解决办法]
hWnd
[in]
Handle to the window whose messages are to be retrieved. The window must belong to the calling thread.
The NULL value has a special meaning:
NULL
GetMessage retrieves messages for any window that belongs to the calling thread and thread messages posted to the calling thread using the PostThreadMessage function.