VB で言うところの DoEvents() である.
長いループの途中などで呼び出す.
void DoEvents()
{
MSG msg;
while( ::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) ) {
::TranslateMessage( &msg );
::DispatchMessage( &msg );
}
}
BOOL DoEvents()
{
MSG msg;
while( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) {
if( !GetMessage(&msg, NULL, 0, 0) ) {
return FALSE; // WM_QUIT を受け取り
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return TRUE;
}
参照
中止ダイアログ
プログレスダイアログ