Created
November 24, 2012 01:40
-
-
Save tuttlem/4137996 to your computer and use it in GitHub Desktop.
MessagePump WinMain
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
WinMain proc hInst :DWORD, | |
hPrevInst :DWORD, | |
szCmdLine :DWORD, | |
nCmdShow :DWORD | |
LOCAL msg :MSG | |
MessagePump_Loop: | |
; take the next message out of the queue to process | |
invoke GetMessage, ADDR msg, NULL, 0, 0 | |
; check if we just processed a WM_QUIT and get out | |
; if we did | |
cmp eax, 0 | |
je MessagePump_Done | |
; translate and dispatch the message as usual | |
invoke TranslateMessage, ADDR msg | |
invoke DispatchMessage, ADDR msg | |
; keep processing messages | |
jmp MessagePump_Loop | |
MessagePump_Done: | |
xor eax, eax | |
ret | |
WinMain endp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment