InputBox Locale changes the behavior in an unexpected way

Report problems with documented functionality
User avatar
Micromegas
Posts: 260
Joined: 28 Apr 2015, 23:02
Location: Germany

InputBox Locale changes the behavior in an unexpected way

28 Jan 2020, 02:44

In v2, InputBox will have the Locale option as default. Therefore, I'm beginning to set it in my code. It turns out, that option changes the behavior in an unexpected, and IMHO not useful way: Instead of the text box, the Cancel button is selected.

Repro steps:
1. Run

Code: Select all

InputBox, return_value, , , , , , , , Locale, , something
msgbox returned: %return_value%. ErrorLevel: %ErrorLevel%
2. Enter {Return}

yields returned: something. ErrorLevel: 1
just me
Posts: 9458
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: InputBox Locale changes the behavior in an unexpected way

28 Jan 2020, 09:21

script2.cpp -> InputBoxProc -> WM_INITDIALOG

Code: Select all

				// Widen the buttons for non-English names (approx. the width of a MsgBox button):
				GetWindowRect(hbtOk, &rect);
				SetWindowPos(hbtOk, NULL, NULL, NULL, 88, rect.bottom - rect.top, SWP_NOMOVE | SWP_NOREDRAW);
				GetWindowRect(hbtCancel, &rect);
				SetWindowPos(hbtCancel, NULL, NULL, NULL, 88, rect.bottom - rect.top, SWP_NOMOVE | SWP_NOREDRAW);
might require SWP_NOZORDER (0x0004).
just me
Posts: 9458
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: InputBox Locale changes the behavior in an unexpected way

03 Mar 2020, 04:19

Would someone with C++ experience please test whether the SWP_NOZORDER would help? Thanks!
just me
Posts: 9458
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: InputBox Locale changes the behavior in an unexpected way

03 Mar 2020, 09:02

... SWP_NOACTIVATE might be an option, too.
User avatar
lmstearn
Posts: 694
Joined: 11 Aug 2016, 02:32
Contact:

Re: InputBox Locale changes the behavior in an unexpected way

04 Mar 2020, 00:44

Something like HWND_NOTOPMOST sometimes helps:

Code: Select all

	SetWindowPos(hbtOk, HWND_NOTOPMOST, NULL, NULL, 88, rect.bottom - rect.top, SWP_NOMOVE | SWP_NOREDRAW);

	SetWindowPos(hbtCancel, HWND_NOTOPMOST, NULL, NULL, 88, rect.bottom - rect.top, SWP_NOMOVE | SWP_NOREDRAW);
Can check for SWP_NOZORDER- it'll be a few days though.
:arrow: itros "ylbbub eht tuO kaerB" a ni kcuts m'I pleH
User avatar
Micromegas
Posts: 260
Joined: 28 Apr 2015, 23:02
Location: Germany

Re: InputBox Locale changes the behavior in an unexpected way

04 Mar 2020, 05:52

Did I misunderstand the purpose of this forum? I posted this specifically under “Bug Reports” to report this, not to receive continuous tinkering with workarounds. I'm unsubscribing the topic now; if there is any comment that treats this as something like a bug report, please send me a private message.
gregster
Posts: 9014
Joined: 30 Sep 2013, 06:48

Re: InputBox Locale changes the behavior in an unexpected way

04 Mar 2020, 07:39

Micromegas wrote:
04 Mar 2020, 05:52
Did I misunderstand the purpose of this forum? I posted this specifically under “Bug Reports” to report this, not to receive continuous tinkering with workarounds. I'm unsubscribing the topic now; if there is any comment that treats this as something like a bug report, please send me a private message.
Workarounds?
As far as I understand, these posts are about a possibly relevant part of AHK's C++ sourcecode; hence, these are contributions that could actually help fix the problem on a general level.

Just as a reminder: all forum members, developers and team members are pure, unpaid volunteers that offer their knowledge and limited free time to the benefit of the community and to the best extent they can.
If this doesn't meet your requirements or isn't "enough bang for the buck", feel free to make a pull request yourself on github, which fixes this problem, or hire a professional. Otherwise, we should welcome any contribution that potentially could lead to the improvement of AHK, even if it should turn out that not every post was spot-on.

Thank you for your understanding!
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: InputBox Locale changes the behavior in an unexpected way

04 Mar 2020, 10:20

gregster wrote:
04 Mar 2020, 07:39
Workarounds?
As far as I understand, these posts are about a possibly relevant part of AHK's C++ sourcecode; hence, these are contributions that could actually help fix the problem on a general level.

Just as a reminder: all forum members, developers and team members are pure, unpaid volunteers that offer their knowledge and limited free time to the benefit of the community and to the best extent they can.
If this doesn't meet your requirements or isn't "enough bang for the buck", feel free to make a pull request yourself on github, which fixes this problem, or hire a professional. Otherwise, we should welcome any contribution that potentially could lead to the improvement of AHK, even if it should turn out that not every post was spot-on.

Thank you for your understanding!
+10000

just me wrote:
03 Mar 2020, 04:19
Would someone with C++ experience please test whether the SWP_NOZORDER would help? Thanks!
Micromegas wrote:
04 Mar 2020, 05:52
Did I misunderstand the purpose of this forum? I posted this specifically under “Bug Reports” to report this, not to receive continuous tinkering with workarounds. I'm unsubscribing the topic now; if there is any comment that treats this as something like a bug report, please send me a private message.
since you've unsubscribed, maybe you won't see this, or maybe you won't care since you think its just a tinkering workaround, but just-me was correct and adding SWP_NOZORDER fixes the bug.

attached to this post is a .zip file containing AHK_H unicode 32bit 1.1.32.0 with the fix if you want it
Attachments
AutoHotkey_H32w-1.1.32.0.zip
(556.65 KiB) Downloaded 100 times

just me
Posts: 9458
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: InputBox Locale changes the behavior in an unexpected way

06 Mar 2020, 05:53

@guest3456, thanks_H! ;)

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 58 guests