Modal Window appears behind main parent window

I do wrap it in #if TargetWin32 ... #endif anyway, but it does seem to be internally protected from being compiled for the wrong platform.

I hope it works in your case!

I’ve seen this too as well, many times the print dialog or the copy files dialog will not come to front.

On Mac, I have had window focus issues in many other applications as well, sometimes I need switch to another application and back to be able to use a modal dialog (Open, Save, etc.)

Well the Monkey bread WinTopMostWindowMBS seems to be working to stop the modal window in back problem in my current testing.

HOWEVER, I am still having trouble with MsgBox dialogs.
If user hits the X and closes the main window with file/document open, then
I put up a dialog that says “Do you want to save the changes you made in this file?”

Well in my testing that sometimes pops up behind the main window… and you don’t see it.
And app doesn’t close. And you can’t access the dialog. And if you click I just get a beep.

Is there a way to force a dialog to the front? Or would I have to instead create a Window
for that dialog and then use the WinTopMostWindowMBS method to keep it in front? Sigh.

I ended up creating a custom message box and used that for dialogs. And then used WinTopMostWindowMBS to make it pop in front.

I still see occasions where some of the windows that have WinTopMostWindowMBS set in the Open still pop behind. Don’t know why. But for now it’s working well enough that I got my big release out the door.