BOOL ProcessMessages(void) { MSG msg; BOOL ret=TRUE; /* get the next message if any */ while(ret) { ret = (BOOL)PeekMessage(&msg,NULL,0,0,PM_REMOVE); /* if we got one, process it */ if (ret) { TranslateMessage(&msg); DispatchMessage(&msg); } } /* TRUE if we got a message */ return ret; }call the above function to process message queue
{
MSG msg;
BOOL ret=TRUE;
/* get the next message if any */
while(ret)
{
ret = (BOOL)PeekMessage(&msg,NULL,0,0,PM_REMOVE);
/* if we got one, process it */
if (ret) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
/* TRUE if we got a message */
return ret;
}call the above function to process message queue
工作线程中的方法就如 masterz 提供的函数,用于处理当前线程的消息