MessageBoxes behind main window

Hello all…

Today I noticed that one of my apps, running under windows 11 home, shows message dialogs behind the main window. I checked in a virtualmachine, and I can’t reproduce the problem.

I use the last Xojo version 2023r4, and the Windows system is updated.

Anyone has suggestions on how I’ll have to dealing with this problem? (Obviously I searched around this forum and Google too without success)

Thanks a lot!

I usually see things like this when the window is shown with ShowModal and it shouldn’t be. Is that maybe the case here?

1 Like

I have to check. This is a good starting point. Thanks for now, I’ll let you know very soon.

What kind of message dialogs are you using? Can you post the code you use to display them?

1 Like

Yeah, it’s annoying. Usually happens to me if the window is floating or global floating or as @Tim_Parnell mentioned is being otherwise shown modally.

I have a recollection that I had to work around that even back in VB6 days when I was writing apps that sat in the tray area monitoring data from connected machines (such as weigh scales in warehouses) and needed to notify the user of something. IIRC, I had to use declares to force the dialog to be the frontmost window, or Windows would bury my dialog behind other windows. But this was back several releases of Windows. My point is this might be more of a Windows thing than Xojo thing. Or not.

2 Likes

Just for an update for all: seems that’s a “stupid user” case.

Watching at the user during work, I think that he usually opens more instances of the same application, and when a messagebox appears in a “back” instance, Windows locks completely all the “windows” of the same application.

So for now I add a Mutex to avoid that “man issue”, and I’ll check it in the next days.

I think this thread must be moved in the “Programming humor” topic :crazy_face:

I’ll update you all soon. For now thanks for your precious support!

1 Like