Maybe I've misunderstood something.
Do you need to have a topmost MessageBox even if there's any other modal form showed?
If this is the case you can again use messagebox with some additional parameters.
In example, calling
MessageBox(0,'Hello, this is a Console Application','Hello',MB_SYSTEMMODAL or MB_SETFOREGROUND or MB_TOPMOST or MB_ICONHAND) ;
You'll have a topmost Message dialog box with a OK button
the most important piece is the last parameter. The "MB_SYSTEMMODAL or MB_SETFOREGROUND or MB_TOPMOST" ensures the message box is system modal, top most and becomes the foreground window.
* MB_SYSTEMMODAL flag ensures that the user must respond to the message box before continuing work in the window identified by the hWnd parameter.
* MB_TOPMOST flag specifies that the message box should be placed above all non-topmost windows and should stay above them, even when the window is deactivated.
* MB_SETFOREGROUND flag ensures that the message box becomes the foreground window.