+ added take-over of icon of %AppExe% ... if we add a TrayIcon someday + added OnClose-handling when using appstart (kills process of main application)
22 lines
338 B
AutoHotkey
22 lines
338 B
AutoHotkey
Counter = 0
|
|
|
|
ToolTip Closing %AppName% ...
|
|
|
|
SplitPath AppExe, AppFile, null, null, null, null
|
|
|
|
TryClose:
|
|
Process Exist, %AppFile%
|
|
If ErrorLevel
|
|
ProgPID = %ErrorLevel%
|
|
Else
|
|
Goto CloseDone
|
|
|
|
WinClose ahk_pid %ProgPID%, , 0.5
|
|
If Counter >= 10
|
|
Process Close, %ProgPID%
|
|
Counter += 1
|
|
Goto TryClose
|
|
|
|
CloseDone:
|
|
ToolTip
|