Creating pop up window to select window

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
s0gy
Posts: 7
Joined: 26 May 2022, 13:57

Creating pop up window to select window

Post by s0gy » 24 Mar 2023, 14:07

Can someone please create or show me how to create a script where a pop up box comes up asking to select window with the hotkey ‘q’ and when q is clicked on a selected window get its data and store it in a variable called %id%

Thanks any help is appreciated!

User avatar
mikeyww
Posts: 26886
Joined: 09 Sep 2014, 18:38

Re: Creating pop up window to select window

Post by mikeyww » 24 Mar 2023, 19:44

Hello,

What is the full series of steps, starting at the beginning before anything has happened? Can you write them, step by step, in order?

s0gy
Posts: 7
Joined: 26 May 2022, 13:57

Re: Creating pop up window to select window

Post by s0gy » 25 Mar 2023, 09:29

Sure,

step 1 click a button which will then have a pop up window asking the user to input q on the window they would like to select, the user should close the popup,

step 2. the user will go to their selected window and click q’

step 3 the window id will be taken and stored in a valuable named ‘id’.

Thanks for the help.

User avatar
mikeyww
Posts: 26886
Joined: 09 Sep 2014, 18:38

Re: Creating pop up window to select window

Post by mikeyww » 25 Mar 2023, 10:44

Code: Select all

#Requires AutoHotkey v2.0
select      := False
id          := 0
showID      := () => MsgBox(id, 'ID')
instruction := 'Type "q" over the target window.'

F3:: {
 Global select := True
 MsgBox instruction, 'Instructions', 64
 ToolTip instruction
}

F4::showID

#HotIf select
q:: {
 Global id, select := False
 MouseGetPos ,, &id
 ToolTip
 SoundBeep 1500
 showID
}
#HotIf

Post Reply

Return to “Ask for Help (v2)”