Program reload to launch a command

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
hemsith14_
Posts: 296
Joined: 07 Nov 2020, 08:37

Program reload to launch a command

Post by hemsith14_ » 28 Jan 2022, 22:09

Hey
Is it possible to get a reload of program to launch a command?
I'm currently using the following method, which only works if the window is getting deactivated and then activated again.
The program reload isn't changing anything notable on it's window spy, so I'm having a hard time figuring out how can I trigger and re-trigger this.

Code: Select all

TmerA := 0
SetTimer, TimerA

TimerA:
If WinActive("ahk_exe Window.exe") && !TimerA
{
TmerA := 1
; Do something
}
If !WinActive("ahk_exe Window.exe")
TimerA := 0
Return
Maybe there is some kind of a process, or something like it that it can follow by saying if process has stopped for more than a second, TimerA := 0?

amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: Program reload to launch a command

Post by amateur+ » 28 Jan 2022, 23:28

Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.

hemsith14_
Posts: 296
Joined: 07 Nov 2020, 08:37

Re: Program reload to launch a command

Post by hemsith14_ » 28 Jan 2022, 23:48

But the process still exists if I reload the program, I need to get info if for example - I opened a new notepad file, but without exiting notepad.

amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: Program reload to launch a command

Post by amateur+ » 29 Jan 2022, 01:15

Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.

Post Reply

Return to “Ask for Help (v1)”