문제

I was wondering if i could get AHK-script to automatically launch a program in the background when i start another.

Example:

Execute C:\any.exe. AHK launches: C:\monitor.exe

When any.exe is closed, ahk should kill monitor.exe

Awsome if you guys could help me.

Edit: Note that i am a complete newcomer to programming or scripting in every way you can think of

도움이 되었습니까?

해결책

Check out timer in the autohotkey docs.

You could set a timer that checks every 5 seconds to run winexist to test for the existence of c:\any.exe - and when it returns true then your code could run c:\monitor.exe

Now that your code knows that c:\any.exe is running, your code could launch a second timer that checks for when its process is closed (check out process in the ahk docs). When it is closed, then use winkill to close the c:\monitor.exe process.

So, look up these commands:

  • winexist
  • timer
  • process
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top