Last active
September 16, 2021 12:34
-
-
Save Tocchann/702d954ba67f5eb8c07f0e8bc2ba757a to your computer and use it in GitHub Desktop.
GetMessage な実装例
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 = { 0 }; | |
BOOL ret; | |
while( (ret=GetMessage( &msg, nullptr, 0, 0 )) != 0 ) | |
{ | |
if( ret == -1 ) | |
{ | |
// 必要に応じてエラー処理を施す。場合によっては終了する | |
} | |
else if( !PreTranslateMessage( &msg ) ) | |
{ | |
TranslateMessage( &msg ); | |
DispatchMessage( &msg ); | |
} | |
} | |
return msg.wParam; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment