How to identify the window ID?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Kevin_yeh2020
Posts: 106
Joined: 11 Apr 2020, 00:54

How to identify the window ID?

Post by Kevin_yeh2020 » 24 Oct 2021, 01:20

Hello,

These are two different programs. I would like to use the program_A to check program_B is open or not? But I found that if I open a window_B.txt also passed inspection.
How to make Window_A check the AHK's Window_B only?

Program_A :

Code: Select all

IfWinNotExist, Window_B
{
MsgBox, 48,, Window_B is not opened
Exitapp
}
Program_B :

Code: Select all

Gui, Show, h90 w150, Window_B
Gui, Color, cBlack
Gui, Font, Norm S45 W900 cRed , Calibri
Gui, Add, Text, x6 y10, PASS
return
GuiClose:
ExitApp

Rohwedder
Posts: 7614
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: How to identify the window ID?

Post by Rohwedder » 24 Oct 2021, 03:41

Hallo,
try:

Code: Select all

IfWinNotExist, Window_B ahk_class AutoHotkeyGUI
{
	MsgBox, 48,, Window_B is not opened
	Exitapp
}

Marcosa1020
Posts: 168
Joined: 23 Sep 2015, 19:15

Re: How to identify the window ID?

Post by Marcosa1020 » 24 Oct 2021, 09:58

Rohwedder wrote:
24 Oct 2021, 03:41
Hallo,
try:

Code: Select all

IfWinNotExist, Window_B ahk_class AutoHotkeyGUI
{
	MsgBox, 48,, Window_B is not opened
	Exitapp
}
Hi Rohwedder,

Thanks.

Post Reply

Return to “Ask for Help (v1)”