首页
社区
课程
招聘
帮我看看这个窗口程序怎么运行没有结果?
2006-8-26 21:53 3956

帮我看看这个窗口程序怎么运行没有结果?

2006-8-26 21:53
3956
1.
代码是照<<Windows32位汇编语言程序设计这本书>>打的,编译没错,可是没有结果?
.386
            .model flat, stdcall
option casemap :none

include           /masm32/include/windows.inc

include           /masm32/include/user32.inc
includelib        /masm32/lib/user32.lib

include           /masm32/include/kernel32.inc
includelib        /masm32/lib/kernel32.lib

include           /masm32/include/gdi32.inc
includelib        /masm32/lib/gdi32.lib

.data?

hInstancedd?
hWndMain          dd    ?

            .const
szClassName       db   'MyClass',0
szCaptionMain     db   'My first Window !',0
szText            db   'Win32 Assembly,Simple and powerful !',0

.code
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;窗口过程
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_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,hWndMain
                invoke  PostQuitMessage,NULL
    .else
                invoke  DefWindowProc,hWnd,uMsg,wParam,lParam
                        ret
                .endif
                xor     eax,eax
                ret
_ProcWinMain    endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_WndMain    proc
            local   @stWndClass : WNDCLASSEX
            local   @stMsg      : MSG
            invoke  GetModuleHandle,NULL
            mov     hInstance ,  eax
            invoke  RtlZeroMemory,addr @stWndClass,sizeof @stWndClass
;**********************************************************************
;注册窗口类
;**********************************************************************
            invoke  LoadCursor , 0 , IDC_ARROW
            mov     @stWndClass.hCursor,eax
            push    hInstance
            pop     @stWndClass.hInstance
            mov     @stWndClass.cbSize,sizeof WNDCLASSEX
            mov     @stWndClass.style,CS_HREDRAW or CS_VREDRAW
            mov     @stWndClass.lpfnWndProc,offset _ProcWinMain
            mov     @stWndClass.lpszClassName,offset szClassName
            invoke  RegisterClassEx,addr @stWndClass
;**********************************************************
;建立并显示窗口
;**********************************************************
            invokeCreateWindowEx,WS_EX_CLIENTEDGE,\
offset szClassName,offset szCaptionMain,\
WS_OVERLAPPEDWINDOW OR WS_VSCROLL OR WS_HSCROLL,\
100,100,550,400,\
NULL,NULL,hInstance,NULL
            invokeShowWindow,hWndMain,SW_SHOWNORMAL
invokeUpdateWindow,hWndMain
;***********************************************************
;消息循环
;***********************************************************
            .while  TRUE
            invokeGetMessage,addr @stMsg,NULL,0,0
.break.if eax== 0
invokeTranslateMessage,addr @stMsg
invokeDispatchMessage,addr @stMsg
            .endw
            ret
_WndMain   endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>         

start:      call       _WndMain
            invoke     ExitProcess,NULL
            end        start

endstart
2.
qeditor.exe  怎么查看 行号?
谢谢

[培训]二进制漏洞攻防(第3期);满10人开班;模糊测试与工具使用二次开发;网络协议漏洞挖掘;Linux内核漏洞挖掘与利用;AOSP漏洞挖掘与利用;代码审计。

收藏
点赞0
打赏
分享
最新回复 (4)
雪    币: 2367
活跃值: (756)
能力值: (RANK:410 )
在线值:
发帖
回帖
粉丝
小虾 10 2006-8-26 22:04
2
0
1、在CreateWindowEx后面少了一句。
mov hWndMain,eax
2、用EditPlus、MasmPlus、RadAsm编辑器都可以看到行号。
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
ffff 2006-8-26 22:28
3
0
谢谢大哥,终于找到组织了.
咱们论坛是给分制吗
如何结帖.
雪    币: 2367
活跃值: (756)
能力值: (RANK:410 )
在线值:
发帖
回帖
粉丝
小虾 10 2006-8-26 23:05
4
0
1、不是给分制。
2、不用结贴。
雪    币: 249
活跃值: (10)
能力值: ( LV12,RANK:250 )
在线值:
发帖
回帖
粉丝
wiaa 6 2006-8-27 11:12
5
0
最初由 ffff 发布
谢谢大哥,终于找到组织了.
咱们论坛是给分制吗
如何结帖.

什么叫做 给分制、结帖?
游客
登录 | 注册 方可回帖
返回