int MessageBox(
  HWND hWnd,          // handle of owner window
  LPCTSTR lpText,     // address of text in message box
  LPCTSTR lpCaption,  // address of title of message box
  UINT uType          // style of message box
);

在uType参数中设置MB_SYSTEMMODAL就能让MessageBox在最上面;

 示例:

MessageBox(_T(" 程序错误!"),_T("Warning"),MB_SYSTEMMODAL|MB_ICONEXCLAMATION|MB_OK);

posted on 2018-10-29 13:27  lazybee  阅读(1844)  评论(0编辑  收藏  举报