Switching Windows with ID's

Ask gaming related questions (AHK v1.1 and older)
dan86
Posts: 13
Joined: 09 Nov 2014, 23:53

Switching Windows with ID's

23 Jan 2024, 09:46

Hello,

I am trying to do different things (scripts) based on which window is active.

when using WinExist() I get an error....
image.png
image.png (15.29 KiB) Viewed 167 times

Code: Select all

!j:: 
	WinGetTitle, JudoasWindowID, A
	ToolTip, %JudoasWindowID%, 1200, 100, 1
return
	
!k::
	WinGetTitle, DaDaDanWindowID, A
	ToolTip, %DaDaDanWindowID%, 1200, 100, 2
	
return
	
!h::
	if WinExist(%JudoasWindowID%){
		WinActivate ;
		ToolTip, Judoas is Active Window, 1200, 300, 3
	}
		
	if WinExist(%DaDaDanWindowID%) {	
		WinActivate ;
		ToolTip, DaDaDan is Active Window, 1200, 300, 4
	}
return	
Any thoughts on how I can do specific things (currently just ToolTip, I'm in testing phase) based on which window is active?

Thanks,
Dan
Last edited by gregster on 23 Jan 2024, 11:51, edited 1 time in total.
Reason: Moved topic from 'Ask for Help (v2) > Gaming' to v1 help since this is v1 code.
Rohwedder
Posts: 7750
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Switching Windows with ID's

23 Jan 2024, 10:21

Hallo,
This is AutoHotkey v1
Remove all percent signs of the WinExist() parameter.
E.g. change WinExist(%JudoasWindowID%) to WinExist(JudoasWindowID)

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 23 guests