Moving MSGBOX to different monitor.

Get help with using AutoHotkey and its commands and hotkeys
User avatar
eblanc
Posts: 71
Joined: 08 May 2019, 14:41

Moving MSGBOX to different monitor.

18 Sep 2019, 17:25

I have a couple of scripts. Evertime there is an Input box, it always pops up on my main monitor (center) I would like to move it to my Right side monitor.

Any ideas?

thanks in advance, you all sexy AHK coders.
User avatar
boiler
Posts: 6629
Joined: 21 Dec 2014, 02:44

Re: Moving MSGBOX to different monitor.

18 Sep 2019, 17:31

Your title says "MSGBOX" but your post says "Input box". If it's an InputBox, it's very easy to have it appear exactly where you want by specifying the x and y coordinates in the InputBox command:
InputBox, OutputVar , Title, Prompt, HIDE, Width, Height, X, Y, Font, Timeout, Default

A MsgBox can also be moved, although not as straightforward, but I can show you if you need to move a MsgBox as well.
User avatar
boiler
Posts: 6629
Joined: 21 Dec 2014, 02:44

Re: Moving MSGBOX to different monitor.

18 Sep 2019, 17:41

Here is a method for moving a MsgBox:

Code: Select all

SetTimer, MoveMsgBox, -50
MsgBox, I have been moved to 0,0
return

MoveMsgBox:
	WinWait, ahk_class #32770 ahk_exe AutoHotkey.exe
	WinMove, ahk_class #32770 ahk_exe AutoHotkey.exe,, 0, 0
return
It creates a second thread via SetTimer that will act after MsgBox appears. You can't simply put the WinMove immediately after the MsgBox command because it won't get to that line until the MsgBox is dismissed.

Return to “Ask For Help”

Who is online

Users browsing this forum: b0dhimind, Bing [Bot], downstairs, Ram and 42 guests