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