Skip to content

Instantly share code, notes, and snippets.

@Tocchann
Last active September 16, 2021 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tocchann/702d954ba67f5eb8c07f0e8bc2ba757a to your computer and use it in GitHub Desktop.
Save Tocchann/702d954ba67f5eb8c07f0e8bc2ba757a to your computer and use it in GitHub Desktop.
GetMessage な実装例
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