How to target one specific window if several have the same name ?

Get help with using AutoHotkey and its commands and hotkeys
Nheyll
Posts: 2
Joined: 09 Sep 2019, 10:27

How to target one specific window if several have the same name ?

09 Sep 2019, 10:43

Hello !
First of all, i apologize because english is not my native langage and i am new to programming.

So what i am trying to do is to open windows with f1, f2, f3, f4.

I found this script wich is working but there is a little problem i will explain later.

loop
{
F1::WinActivate,[name of the window]
F2::WinActivate,[name of the window]
F3::WinActivate,[name of the window]
F4::WinActivate,[name of the window]
F5::ExitApp
}

The problem i face is that all the windows have the same name, so i can't target one specifically.

Maybe it is possible to target a window by its position ? Maybe there is another solution ?

Thanks for reading me and i hope you can help.
ilhom
Posts: 52
Joined: 19 Aug 2019, 17:58

Re: How to target one specific window if several have the same name ?

09 Sep 2019, 11:00

WinActivate will only target the topmost window.

You will want to look into GroupAdd.
https://www.autohotkey.com/docs/commands/GroupAdd.htm

This will cycle through the windows with F1.

Code: Select all

GroupAdd, winvar, [name of the window]
return
F1::GroupActivate, winvar
Nheyll
Posts: 2
Joined: 09 Sep 2019, 10:27

Re: How to target one specific window if several have the same name ?

09 Sep 2019, 11:11

Thanks you for your answer i'll check that !

Return to “Ask For Help”

Who is online

Users browsing this forum: famko, teadrinker and 38 guests