Archived
1
0
This repository has been archived on 2025-03-31. You can view files and clone it, but cannot push or open issues or pull requests.
U3Helper/U3H_appStop.ahk
mbirth cb21cfa589 x check for existence of INI-file to parse before doing anything
x OnExit-removal and missing ExitApp
x changed Progress-title for appStop
2007-04-13 21:13:19 +00:00

45 lines
1014 B
AutoHotkey

ASOnExit:
StepsAll = 1
If (StrLen(RunBeforeStop) > 0)
StepsAll++
StepsStep := 100/StepsAll
StepsPos = 0
Progress b2 x%PL% y%PT% w%PW% m FM%PFM% FS%PFS%, U3Helper %U3HVer% - (c)2006-2007 Markus Birth <mbirth@webwriters.de>, Stopping %AppName% ..., AHKProgress-%AppName%
WinSet Transparent, %PTrans%, AHKProgress-%AppName%
If (StrLen(RunBeforeStop) > 0)
{
Progress % StepsPos*StepsStep, Running stop command ...
RunBeforeStop := EnvParseStr(RunBeforeStop)
RunWait %RunBeforeStop%
StepsPos++
}
SplitPath AppExe, AppFile, null, null, null, null
Counter = 0
CounterMax = 10
TryClose:
Progress % StepsPos*StepsStep+StepsStep*Counter/CounterMax, Stopping %AppName% ...
Process Exist, %AppFile%
If ErrorLevel
ProgPID = %ErrorLevel%
Else
Goto CloseDone
WinClose ahk_pid %ProgPID%, , 0.5
If Counter >= %CounterMax%
{
Progress 100, Killing %AppName% ...
Process Close, %ProgPID%
}
Counter += 1
Goto TryClose
CloseDone:
Progress 100, appStop done.
ExitApp