您的位置:首页 > 其它

win32的消息窗口使用   ---- 学习记录

2016-03-20 15:23 691 查看
/*
消息窗口的定义
int MessageBox(HWND hWnd,LPCTSTR lpText,LPCTSTR lpCaption,UINT uType);
hWnd 工作窗口句柄
lpText 在消息窗口中展示的信息
lpCaption 消息窗口中的标题
uType 定义各种图标及输入属性(影响消息窗口的显示及行为)
{影响显示的参数
MB_ICONQUESTION #询问信息提示图标
MB_ICONWARNING #警告信息提示图标
MB_ICONINFORMATION #信息提示图标
MB_ICONERROR #错误信息提示图片
影响行为的参数
MB_ABORTRETRYIGNORE   Abort, Retry, and Ignore
MB_CANCELTRYCONTINUE Cancel, Try Again, and Continue
MB_HELP Help
MB_OK OK
MB_OKCANCEL OK and Cancel
MB_RETRYCANCEL Retry and Cancel
MB_YESNO Yes and No
MB_YESNOCANCEL Yes, No, and Cancel

行为结果参数
IDABORT Abort button was pressed
IDCANCEL Cancel button was pressed
IDCONTINUE Continue button was pressed
IDIGNORE Ignore button was pressed
IDNO No button was pressed
IDOK OK button was pressed
IDRETRY Retry button was pressed
IDTRYAGAIN Try Again button was pressed
IDYES Yes button was pressed
}

*/
int nResult = MessageBox (NULL,
_T("An example of Cancel,Retry,Continue" ),
_T("Hello Message Box!" ),
MB_ICONERROR | MB_ABORTRETRYIGNORE );

switch (nResult)
{
case IDABORT :
// 'Abort' was pressed
break;
case IDRETRY :
// 'Retry' was pressed
break;
case IDIGNORE :
// 'Ignore' was pressed
break;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: