MsgBox/InputBox gets hidden under another window (+ InputBox custom font)
Posted: 14 Feb 2017, 10:55
Sometimes an AutoHotkey MsgBox/InputBox is created,
but immediately gets hidden under another window.
Although if you press Enter, the MsgBox/InputBox receives the key press.
I don't remember this happening in Windows XP,
but it does happen in Windows 7.
And it is still happening in the latest version of AutoHotkey (v1.1.24.05).
This was such a major issue for me that I had to replace
all instances of the MsgBox/InputBox command
with a custom function.
I seem to have a working solution, although sometimes if I deliberately
navigate to another window first and then go back and deal with the MsgBox,
it then takes me back to the original window, which can be a bit of surprise.
So I might tweak this.
I wondered if anyone else had been affected by or tried to resolve this problem.
Possibly relevant links:
Input Box Location - Ask for Help - AutoHotkey Community
https://autohotkey.com/board/topic/5815 ... -location/
Msgbox is often hidden - Ask for Help - AutoHotkey Community
https://autohotkey.com/board/topic/1157 ... en-hidden/
but immediately gets hidden under another window.
Although if you press Enter, the MsgBox/InputBox receives the key press.
I don't remember this happening in Windows XP,
but it does happen in Windows 7.
And it is still happening in the latest version of AutoHotkey (v1.1.24.05).
This was such a major issue for me that I had to replace
all instances of the MsgBox/InputBox command
with a custom function.
Code: Select all
q:: ;code that should replicate the problem (eventually the MsgBox will be hidden under another window)
Run, notepad.exe
WinWaitActive, ahk_class Notepad
Loop, 30
MsgBox
Return
;w:: ;code that appears to avoid the problem
Run, notepad.exe
WinWaitActive, ahk_class Notepad
WinGet, hWnd, ID, A
Loop, 30
{
MsgBox
WinActivate, ahk_id %hWnd%
}
Return
navigate to another window first and then go back and deal with the MsgBox,
it then takes me back to the original window, which can be a bit of surprise.
So I might tweak this.
I wondered if anyone else had been affected by or tried to resolve this problem.
Possibly relevant links:
Input Box Location - Ask for Help - AutoHotkey Community
https://autohotkey.com/board/topic/5815 ... -location/
Msgbox is often hidden - Ask for Help - AutoHotkey Community
https://autohotkey.com/board/topic/1157 ... en-hidden/