QB64 Phoenix Edition
_messagebox Z-Order - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10)
+---- Thread: _messagebox Z-Order (/showthread.php?tid=3546)



_messagebox Z-Order - ahenry3068 - 03-22-2025

Is there a way to make sure a _messagebox  call will always be above other Windows.    It works as expected on Linux but on Windows sometimes the Z-order is behind the other window's (usually the console) and I'll have to bring it forward.      This isn't fatal to my application but it is annoying.


RE: _messagebox Z-Order - Petr - 03-22-2025

Sometimes helps to call _AutoDisplay before calling _MessageBox.


RE: _messagebox Z-Order - tantalus - 03-22-2025

This is a Linux users two pence worth... I've not dabbled in Windows since XP.

Maybe going this route, and specifying MB_TOPMOST as part of the Type flags?

https://qb64phoenix.com/qb64wiki/index.php/Windows_Libraries#Message_Box


RE: _messagebox Z-Order - ahenry3068 - 03-22-2025

(03-22-2025, 10:27 PM)Petr Wrote: Sometimes helps to call _AutoDisplay before calling _MessageBox.

   I will try this first before I take a dive into Tantalus's suggestion.    Hopefully it will do it.   (Much less code to deal with).


Thank You.

(03-22-2025, 10:43 PM)tantalus Wrote: This is a Linux users two pence worth... I've not dabbled in Windows since XP.

Maybe going this route, and specifying MB_TOPMOST as part of the Type flags?

https://qb64phoenix.com/qb64wiki/index.php/Windows_Libraries#Message_Box


 This does look like it will solve the problem.   I'll go this route if I have too,

Thank you.     I am going to try the previous suggestion and see if that works first.


RE: _messagebox Z-Order - Kernelpanic - 03-23-2025

For me the box always stays in front.

Code: (Select All)

'Messageboxuebung - 23. Maerz 2025
'https://qb64phoenix.com/qb64wiki/index.php/MESSAGEBOX_(function)

Option _Explicit

Dim As Integer eingabe

'Sprungmarke
Nochmal:

Locate 3, 3
Input "Eine Zahl groesser 9 und kleiner 15: ", eingabe

Select Case eingabe
  Case 10 To 15
    Locate 5, 3
    Beep: Print "Korrekt"
  Case Else
    'Ungleich 1 bedeutet 0 fuer Abbrechen/Nein, oder 2 fuer Nein in yesnocancel
    If _MessageBox("Fehlermeldung", "Eingabe war falsch!", "okcancel", "error") <> 1 Then
      Cls
      GoTo Nochmal
    Else
      Beep: System
    End If
End Select

End