Wildcard or matching 2 ahk_class

Get help with using AutoHotkey and its commands and hotkeys
Kagerjay
Posts: 9
Joined: 04 Nov 2017, 08:57
GitHub: Kagerjay

Wildcard or matching 2 ahk_class

16 Nov 2017, 15:46

I used winspy to grab an ahk_class for my autohotkey macro. Sometimes that application has 2+ ahk_classes associated with that program

Example:

Code: [Select all] [Download] GeSHi © Codebox Plus

HwndWrapper[program.exe;;1111-1111]
HwndWrapper[program.exe;;2222-2222]


How can I use winNotExist to simply just match both names? Or perhaps use a `||`, `OR` etc?

E.g.

Code: [Select all] [Download] GeSHi © Codebox Plus

+F16::
IfWinNotExist, ahk_class HwndWrapper[program.exe;;1111-1111]
Run, program.exe
GroupAdd, kjexplorers16, ahk_class HwndWrapper[program.exe;;1111-1111]
if WinActive("ahk_exe program.exe")
GroupActivate, kjexplorers16, r
else
WinActivate ahk_class HwndWrapper[program.exe;;1111-1111]
Return

Return to “Ask For Help”

Who is online

Users browsing this forum: AdamKun47, boiler, John316, rakesha002, tarantules and 47 guests