WinActivate with Pid Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Reloaded
Posts: 283
Joined: 25 Aug 2017, 08:48

WinActivate with Pid

07 Jan 2019, 08:48

Hey, ^^

I have here my Code and i just want to get the Pid of the programm that i use at the moment, than start the game and than switch to the saved pid, but its dont work!
Its just saves the Pid, starts the game but dont switch back. Line 5!

Code: Select all

Numpad1::
WinGet, var, PID, a ; Get the pid of the screen at the moment 
Run, "C:\Users\Star\Desktop\1\Games\League of legends.lnk" ; The game
Sleep, 2000
WinActivate, var, , 0 ; Now it should activate the saved screen but its dont work!
Sleep, 4000
WinActivate, League of Legends, , 0 ; And here all work
MouseMove, 1427, 409
Send, "Password"
Send, {Enter}
return
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: WinActivate with Pid  Topic is solved

07 Jan 2019, 08:56

hello, try, ahk_pid %var%

Cheers.
User avatar
Reloaded
Posts: 283
Joined: 25 Aug 2017, 08:48

Re: WinActivate with Pid

07 Jan 2019, 11:46

Helgef wrote:
07 Jan 2019, 08:56
hello, try, ahk_pid %var%

Cheers.
Thanks <3

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: yuke070 and 105 guests