+ -
当前位置:首页 → 问答吧 → 罗云彬程序的疑问

罗云彬程序的疑问

时间:2011-07-26

来源:互联网

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; 窗口过程
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_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 // 把这里去掉
为什么我把最后的ret去掉会出现无限重复的窗口呢,好像死循环了


作者: aerfaxing   发布时间: 2011-07-26

窗口过程要返回呀,汇编和C之类的语言不一样,要显式写返回语句。

如果你要知道为什么死循环,你可能要trace到windows的窗口管理器中。

作者: mydo   发布时间: 2011-07-26

学习了。

作者: wildler   发布时间: 2011-07-26

http://www.1000do.info/2011721/273004.htm

作者: zz331335144   发布时间: 2011-07-26

热门下载

更多