读书人

关于GetMessage的有关问题

发布时间: 2013-01-06 15:44:47 作者: rapoo

关于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.

读书人网 >C语言

热点推荐