Is there a simple way to display a message box in a Win32 (MFC) application which
- locks all windows of the current application and
- which stays in front of all application windows?
I.e. I am looking for a “process-modal” message box.
The standard Win32 MessageBox() function locks only the window (and its parent windows) passed as first argument. If the application has more than one top-level window, MessageBox() does not lock all top-level windows.
You can lock all windows by disabling each window when you show the message box, and enabling them afterwards. That is all the standard modal dialog does.
As for staying on top,
SetWindowPos()allows it to be set on top of all windows or a specific window, it’s not limited to a whole process.