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);