Created
September 16, 2021 12:50
-
-
Save Tocchann/7d1ac8c4f26090ed5110e3d44fb00338 to your computer and use it in GitHub Desktop.
PeekMessage による例
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int RunMessageLoop() | |
{ | |
MSG msg; | |
do{ | |
if( PeekMessage( &msg, nullptr, 0, 0, PM_REMOVE ) ) | |
{ | |
if( msg.message != WM_QUIT && !PreTranslateMessage( &msg ) ) | |
{ | |
TranslateMessage( &msg ); | |
DispatchMesage( &msg ); | |
} | |
} | |
else | |
{ | |
// TODO メッセージがない時にアイドル処理を行わせる場合はここで何かする | |
WaitMessage(); | |
} | |
}while( msg.message != WM_QUIT ); | |
return msg.wParam; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment