GetMessage返回值:如果函数取得WM_QUIT之外的其他消息,返回非零值。如果函数取得WM_QUIT消息,返回值是零。如果出现了错误,返回值是-1。例如,当hWnd是无效的窗口句柄或lpMsg是无效的指针时。若想获得更多的错误信息,请调用GetLastError函数。
.386
.model flat, stdcall
option casemap :none ; case sensitive
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
include \masm32\include\masm32.inc
includelib\masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\m32lib\masm32.lib
.data
dwHandle HWND 0
.code
start:
invoke GetModuleHandle,NULL
mov dwHandle,eax
.while TRUE
invoke GetMessage,addr dwMsg,addr dwHandle,0,0
.break .if eax==-1; the while loop will break at here
invoke TranslateMessage, ADDR dwMsg
invoke DispatchMessage, ADDR dwMsg
.endw
invoke ExitProcess,0
end start
阅读(941) | 评论(0) | 转发(0) |