MessageRequester bug

Windows specific forum
tua
User
User
Posts: 68
Joined: Sun Jul 23, 2023 8:49 pm
Location: BC, Canada

MessageRequester bug

Post by tua »

Code: Select all

  If MessageRequester("Title", "Press a button!", #PB_MessageRequester_YesNo) = #PB_MessageRequester_Yes   
    Debug "Yes"
  Else                               
    Debug "No"
  EndIf

Pressing the [X] button from the system menu in the caption bar results in no visible action, when it should close the dialog, as it does in all Windows applications known to mankind.
User avatar
kenmo
Addict
Addict
Posts: 2032
Joined: Tue Dec 23, 2003 3:54 am

Re: MessageRequester bug

Post by kenmo »

YesNo forces the user to select Yes or No, you can use YesNoCancel instead to allow canceling out of it.
BarryG
Addict
Addict
Posts: 4122
Joined: Thu Apr 18, 2019 8:17 am

Re: MessageRequester bug

Post by BarryG »

tua wrote: Thu Apr 17, 2025 10:29 pmPressing the [X] button from the system menu in the caption bar results in no visible action
How are you doing that when the [X] isn't even enabled? Or is that your point? Regardless, this is not a bug.

Image
tua wrote: Thu Apr 17, 2025 10:29 pmas it does in all Windows applications known to mankind
Not true. Any app that uses the system Yes/No dialog (not a custom one) will have the [X] disabled.
tua
User
User
Posts: 68
Joined: Sun Jul 23, 2023 8:49 pm
Location: BC, Canada

Re: MessageRequester bug

Post by tua »

Image

It's certainly enabled on my setup - precisely why I filed this ... Win 11 Pro, latest beta

The state of the Close button in the system menu (caption bar) of a message dialog in Windows 11 depends on how the dialog is configured by the application or system. Typically, the Close button is active unless one of the following applies:

Dialog Type: Some system modal dialogs, such as critical system alerts or confirmation dialogs, disable the Close button to ensure the user addresses the dialog content explicitly.

Window Style Flags: Developers can set specific window style flags (like WS_SYSMENU for having a system menu or WS_DISABLED to disable user interaction) in the dialog's creation process. Omitting or disabling these features can make the Close button inactive.

Custom Behavior: Applications might use event handling to override the functionality or state of the Close button, preventing it from working even when it's visible.

Thus, if the button is active, it should close the dialog - which it does NOT. I stand by my bug classification.
User avatar
DeanH
Enthusiast
Enthusiast
Posts: 274
Joined: Wed May 07, 2008 4:57 am
Location: Adelaide, South Australia
Contact:

Re: MessageRequester bug

Post by DeanH »

I have both Win 10 and 11 systems. Win 11 is 23H2.

Both behave the same for me, the way BarryG describes.

With #PB_MessageRequesterYesNo the cross is grey and inactive.

With #PB_MessageRequesterYesNoCancel the cross is active and returns a Cancel.

Could it be something to do with 24H2? Or maybe a setting somewhere? I'm not cluey enough but what I am seeing does not match what you have shown.
BarryG
Addict
Addict
Posts: 4122
Joined: Thu Apr 18, 2019 8:17 am

Re: MessageRequester bug

Post by BarryG »

DeanH wrote: Fri Apr 18, 2025 3:31 amCould it be something to do with 24H2?
Yes - it is. I just tried Win 11 Pro (24H2) now and I get the same red [X] when I hover over it.

@tua: Please include your OS and PureBasic version in future reports, so we know what to test with. I initially tested with Win 10.
Last edited by BarryG on Fri Apr 18, 2025 10:55 am, edited 1 time in total.
Fred
Administrator
Administrator
Posts: 18153
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: MessageRequester bug

Post by Fred »

The raw API call does the same here, can you confirm ?

Code: Select all

MessageBox_(0, "Hello", "World", #MB_YESNO)
Little John
Addict
Addict
Posts: 4775
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: MessageRequester bug

Post by Little John »

Confirmed with PB 6.21 beta 5 (x64) on Windows 11 Pro 24H2.
User avatar
Lord
Addict
Addict
Posts: 900
Joined: Tue May 26, 2009 2:11 pm

Re: MessageRequester bug

Post by Lord »

Both snippets show the same result:

Close button turns red when hovered on over the button.
A click doesn't take any action.
Both Boxes only resonses to "Yes" or "No".

Win11pro 24H2, (still) PB v6.20(x64)
Image
Fred
Administrator
Administrator
Posts: 18153
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: MessageRequester bug

Post by Fred »

Thanks so it seems to be a Windows 22H4 issue
BarryG
Addict
Addict
Posts: 4122
Joined: Thu Apr 18, 2019 8:17 am

Re: MessageRequester bug

Post by BarryG »

It's definitely a Win 11 (24H2) issue. The raw API code you gave shows a red [X] when hovered over it, but not on Win 10.

So not a PureBasic bug after all.
Quin
Addict
Addict
Posts: 1122
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: MessageRequester bug

Post by Quin »

Can confirm that it's 24H2 only, can also get it to happen on IoT 2024, based on 24H2.
Oh Microsoft...thanks for being consistently inconsistent.
User avatar
Piero
Addict
Addict
Posts: 863
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: MessageRequester bug

Post by Piero »

Wish I could post a sarcastic comment, but I'm scared by macos sequoia
Quin
Addict
Addict
Posts: 1122
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: MessageRequester bug

Post by Quin »

Piero wrote: Fri Apr 18, 2025 3:10 pm Wish I could post a sarcastic comment, but I'm scared by macos sequoia
After the mess that is System Settings and modern VoiceOver, all the big companies have some weirdness on their plate:D
Little John
Addict
Addict
Posts: 4775
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: MessageRequester bug

Post by Little John »

Piero wrote: Fri Apr 18, 2025 3:10 pm Wish I could post a sarcastic comment, but I'm scared by macos sequoia
If you have nothing to say on topic, why don't you just shut up? :(
Locked