1、不太明白第4章中第一个程序,为什么窗口过程中有时用传入的参数hWnd 有时又用全局变量hWinMain
2、还有就是窗口过程如何知道中的postquitmessage的wm_quit消息发给谁?
_ProcWinMain proc uses ebx edi esi,hWnd,uMsg,wParam,lParam
local @stPs : PAINTSTRUCT
local @stRect : RECT
local @hDc
mov eax,uMsg
;********************************************************************
.if eax == WM_PAINT
invoke BeginPaint,hWnd,addr @stPs
mov @hDc,eax
invoke GetClientRect,hWnd,addr @stRect
invoke DrawText,@hDc,addr szText,-1,\
addr @stRect,\
DT_SINGLELINE or DT_CENTER or
DT_VCENTER
invoke EndPaint,hWnd,addr @stPs
;********************************************************************
.elseif eax == WM_CLOSE
invoke DestroyWindow,hWinMain
invoke PostQuitMessage,NULL
;********************************************************************
.else
invoke
DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
;********************************************************************
xor eax,eax
ret
_ProcWinMain endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[ 本帖最后由 waterwind 于 2009-11-18 20:00 编辑 ]