发新话题
打印

关于《Windows 环境下32 位汇编语言程序设计》中的几个疑问?

关于《Windows 环境下32 位汇编语言程序设计》中的几个疑问?

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 编辑 ]

TOP

hWnd ==  hWinMain
因为前面有 hWinMain =  hWnd ;这句.
它们是相同的.
http://www.cracking.com.cn
有大能耐尚需谦逊三分行事
无甚本领更应夹好尾巴做人

TOP

发新话题
最近访问的版块