| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 611 人关注过本帖
标题:32位汇编MessageBox的问题
只看楼主 加入收藏
Agdmeg
Rank: 4
来 自:四川成都
等 级:业余侠客
威 望:3
帖 子:101
专家分:201
注 册:2011-8-9
结帖率:92.31%
收藏
已结贴  问题点数:4 回复次数:4 
32位汇编MessageBox的问题
假如程序中调用MessageBox函数:
invoke MessageBox,NULL,offset ExitMsg,offset AppName,MB_OKCANCEL
我要怎么样才能处理MessageBox中单击“确认”按钮这个消息?
搜索更多相关主题的帖子: 怎么样 
2012-11-02 16:51
有容就大
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:东土大唐
等 级:版主
威 望:74
帖 子:9048
专家分:14309
注 册:2011-11-11
收藏
得分:4 
看下这个怎么样
程序代码:
;  #define IDOK 1
;  #define IDCANCEL 2
;  #define IDABORT 3
;  #define IDRETRY 4
;  #define IDIGNORE 5
;  #define IDYES 6
;  #define IDNO 7
;  #if(WINVER >= 0x0400)
;  #define IDCLOSE 8
;  #define IDHELP 9

        .386
        .model flat, stdcall
        option casemap:none
  
include       windows.inc
include       gdi32.inc
includelib    gdi32.lib
include       user32.inc
includelib    user32.lib
include       kernel32.inc
includelib    kernel32.lib       

         .data?
hInstance     dd    ?
hWinMain      dd    ?

        .const
szText        db    'xx', 0
szTextOne     db    'gg', 0
szCaption     db    'oo', 0
szCaptionOne  db    'jj', 0

        .code
_WinMain    proc   

        invoke    MessageBox, NULL, offset szText, offset szCaption, MB_YESNO or MB_ICONQUESTION
        cmp       eax, 6
        jne       ok
        invoke    MessageBox, NULL, offset szTextOne, offset szCaptionOne, MB_OK
    ok:    ret

_WinMain endp

start:      
        call      _WinMain
        invoke    ExitProcess, NULL
        end       start


梅尚程荀
马谭杨奚







                                                       
2012-11-02 21:50
Agdmeg
Rank: 4
来 自:四川成都
等 级:业余侠客
威 望:3
帖 子:101
专家分:201
注 册:2011-8-9
收藏
得分:0 
貌似可以,那这样为什么不行?
 invoke    MessageBox, NULL, offset szText, offset szCaption, MB_YESNO or MB_ICONQUESTION
.if eax==IDYES
  invoke .....
  ....
2012-11-03 00:19
无敌小默然
Rank: 1
等 级:新手上路
威 望:1
帖 子:8
专家分:5
注 册:2010-11-27
收藏
得分:0 
在eax中有调用这个函数的返回值,就是MB_OK
2012-11-07 09:40
水哥
Rank: 5Rank: 5
等 级:贵宾
威 望:15
帖 子:65
专家分:111
注 册:2012-8-11
收藏
得分:0 
#define IDOK 1
#define IDCANCEL 2   
#define IDABORT 3   
#define IDRETRY 4   
#define IDIGNORE 5   
#define IDYES 6   
#define IDNO 7   
#if(WINVER >= 0x0400)   
#define IDCLOSE 8  
#define IDHELP 9
2012-11-07 12:50
快速回复:32位汇编MessageBox的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011909 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved