script dialog boxes to stay in same monitor/window as editor

Editor for AutoHotkey written completely in AutoHotkey.

Moderator: maestrith

Sceptre4444
Posts: 1
Joined: 31 Dec 2021, 13:09

script dialog boxes to stay in same monitor/window as editor

Post by Sceptre4444 » 03 Jan 2022, 11:58

I am a basic beginner AHK user. I wish to know if AHK studio has a way of outputting its scripts to the same monitor as where the AHK studio editor resides?

I have 6 monitors, and I use a program called actual windows manager to control where program windows go, which sometimes works, other times not so much (but overall is a very good program). It has the ability, *sometimes* to lock child windows/dialog boxes to certain monitors/parent program, or where the mouse is, or X,Y coordinates. It doesn't work with AHK studio, and several other programs.

When I run this code that I got from an ahk tutorial video,

Code: Select all

InputBox, OutputVar,WHat should this do,Yes or No,,400,300,,,,15, fack me
MsgBox % OutputVar,tittle,text,15
which is my ahk sophistication level, the result is that the input box goes to the primary monitor, and after the timeout, the message box appears in the same Primary Monitor, as well, and I want both to stay in the monitor with AHK studio, which 95% of the time is not the primary monitor.

Is there an option within AHK studio to have dialog type boxes appear in the same monitor as the AHK studio script I am triggering them from? Preferably, on top, activated.

otherwise should I do this with an AHK script?
2) Since this occuring with other programs as well, I thought it might be a good beginner project to have child windows stay with their parent Window in which ever monitor the parent is residing, disregarding if the monitor is Primary or not, a request that seems perfect for an AHK script. Granted, at my current level, I'll just pasting it in to the AHK blindly with small adaptions, but it would be something meaningful to work towards to make my life easier.

Return to “AHK Studio”