In the Help file it says to use a variable to store the newly launched program's unique Process ID. When I tried doing this the program did launch hidden (I can see it in Task Manager) but I can't get it to unhide no matter what I try.
I even tried taking the keystrokes out so that all it would do is launch hidden, sleep for 2 sec, and then unhide. But that didn't work either.
Code: Select all
Run, "C:\Windows\write.exe", , Hide, pid
WinWait, ahk_pid %pid%
Sleep 2000
WinShow, ahk_pid %pid%
The keystrokes that I want to send to the hidden window is: Send, !hPSA which has been tested on a normal window and works fine.
So I was trying to use the following with the script above:
Code: Select all
ControlSend, NetUIHWND1, {Alt down}h{Alt up}PSA, ahk_pid %pid%