MFC 中MessageBox 显示在所有窗口的最上面

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

原文地址:https://www.cnblogs.com/small-lazybee/p/9870154.html