XiaoHui.net 笑汇程序员论坛首页
工作并快乐着,职业并休闲着
寻梦的岁月从不言辛苦几许,
不问收获几多……
» 游客:  申请新用户 | 登录 | 会员 | 统计 | 帮助 » XiaoHui.Net 笑汇程序员论坛 | 纯文字版 | 全站索引 | XiaoHui.com


[其他] AfxMassageBox()的格式是什么?

RSS 订阅当前论坛  

上一主题 下一主题
     

标题: [其他] AfxMassageBox()的格式是什么?  
 
龙主人
小水手
Rank: 1



UID 25843
精华 0
积分 33
帖子 33
阅读权限 10
注册 2006-11-24
来自 濮阳
状态 离线
AfxMassageBox()的格式是什么?

AfxMassageBox()的格式是什么?怎样得到他的返回值?用AfxMassageBox()如何在对话框中得到两个按扭,如:是,
2007-3-11 15:15#1
查看资料  Blog  发短消息  顶部
 
XiaoHui
管理员
Rank: 9Rank: 9Rank: 9


UID 2
精华 1
积分 4861
帖子 4851
阅读权限 200
注册 2001-1-23
来自 猎户星座
状态 离线
查看MSDN帮助, 有详细说明.

要得到返回值, 则调用时, 获取其值:

int t_iRet = AfxMassageBox(...)
第二个参数指定按纽的类型. 你按了指定的哪个按纽, 则返回相应的按纽ID.

例如:

int t_iRet = AfxMessageBox( _T("test string"), MB_YESNO );
如果用户下了 YES, 则 t_iRet 的值为 IDYES

QUOTE:
Displays a message box on the screen.

int AfxMessageBox(
   LPCTSTR lpszText,
   UINT nType = MB_OK,
   UINT nIDHelp = 0
);
int AFXAPI AfxMessageBox(
   UINT nIDPrompt,
   UINT nType = MB_OK,
   UINT nIDHelp = (UINT
) -1
);
Parameters
lpszText
Points to a CString object or null-terminated string containing the message to be displayed in the message box.
nType
The style of the message box. Apply any of the message-box styles to the box.
nIDHelp
The Help context ID for the message; 0 indicates the application's default Help context will be used.
nIDPrompt
A unique ID used to reference a string in the string table.
Return Value
Zero if there is not enough memory to display the message box; otherwise, one of the following values is returned:

IDABORT   The Abort button was selected.
IDCANCEL   The Cancel button was selected.
IDIGNORE   The Ignore button was selected.
IDNO   The No button was selected.
IDOK   The OK button was selected.
IDRETRY   The Retry button was selected.
IDYES   The Yes button was selected.


飞往猎户星座....
2007-3-11 21:33#2
查看资料  访问主页  Blog  发短消息  顶部
     


  可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题  


 


所有时间为 GMT+8, 现在时间是 2008-12-2 02:15 Powered by Discuz! 4.1.0 清除 Cookies - XiaoHui.Net 笑汇程序员论坛 - Archiver