Skip to content

Instantly share code, notes, and snippets.

@Tocchann
Created September 16, 2021 12:50
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/7d1ac8c4f26090ed5110e3d44fb00338 to your computer and use it in GitHub Desktop.
Save Tocchann/7d1ac8c4f26090ed5110e3d44fb00338 to your computer and use it in GitHub Desktop.
PeekMessage による例
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