当前位置: 代码迷 >> 汇编语言 >> 消息处理函数有关问题
  详细解决方案

消息处理函数有关问题

热度:8112   发布时间:2013-02-26 00:00:00.0
消息处理函数问题
_ProcWinMain         proc   uses   ebx   edi   esi,hWnd,uMsg,wParam,lParam
                                local   @stPs:PAINTSTRUCT
                                local   @stRect:RECT
                                local   @hDc

                                mov   eax,uMsg
                              .if   eax==WM_CREATE

          invoke         CreateWindowEx,NULL,\
                                                      offset   szButton,offset   szButtonText,\
                                                      WS_CHILD   or   WS_VISIBLE,\
                                                      10,10,65,22,\
                                                      hWnd,1,hInstance,NULL

                              .elseif   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
  相关解决方案