MessageBox 参数说明

≡放荡痞女 提交于 2019-11-28 15:28:34

MessageBox in comm use: 

MessageBox("....");

输出字符" .....".

int result = MessageBox("Are you want to save context before Exit ?","AlertDialog",MB_ICONINFORMATION|MB_YESNOCANCEL);

MB_YESNOCANCEL  代表有三个按键,参数定义如下:
1 #define MB_OK                       0x00000000L
2 #define MB_OKCANCEL                 0x00000001L
3 #define MB_ABORTRETRYIGNORE         0x00000002L
4 #define MB_YESNOCANCEL              0x00000003L
5 #define MB_YESNO                    0x00000004L
6 #define MB_RETRYCANCEL              0x00000005L

返回值参数定义如下:

 1 /*
 2  * Dialog Box Command IDs
 3  */
 4 #define IDOK                1
 5 #define IDCANCEL            2
 6 #define IDABORT             3
 7 #define IDRETRY             4
 8 #define IDIGNORE            5
 9 #define IDYES               6
10 #define IDNO                7

返回值的参数与用户选择的按键有关,例如 当按下 Yes键 返回值为 IDYES.

因此,这个可以用于当要执行某种操作时,提示用户做出选择。

 

end

thanks.

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!