generated from Nigh/ahk-autoupdate-template
-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathapp.ahk
69 lines (60 loc) · 1.24 KB
/
app.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#Requires AutoHotkey v2.0
SetWorkingDir(A_ScriptDir)
#Warn Unreachable, Off
#SingleInstance force
#include meta.ahk
#include *i compile_prop.ahk
;@Ahk2Exe-IgnoreBegin
if A_Args.Length > 0
{
for n, param in A_Args
{
RegExMatch(param, "--out=(\w+)", &outName)
if(outName[1]=="version") {
f := FileOpen(versionFilename,"w","UTF-8-RAW")
f.Write(version)
f.Close()
ExitApp
}
}
}
_exit(ThisHotkey){
ExitApp
}
_reload(ThisHotkey){
Reload
}
Hotkey("F5", _exit)
Hotkey("F6", _reload)
;@Ahk2Exe-IgnoreEnd
#include update.ahk
OnExit(trueExit)
; ===============================================================
; ===============================================================
; your code below
#include ahko.ahk
setTray()
Return
GuiClose:
ExitApp
trueExit(ExitReason, ExitCode){
ExitApp
}
; ===============================================================
; ===============================================================
UAC()
{
full_command_line := DllCall("GetCommandLine", "str")
if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)")) {
try
{
if A_IsCompiled
Run '*RunAs "' A_ScriptFullPath '" /restart'
else
Run '*RunAs "' A_AhkPath '" /restart "' A_ScriptFullPath '"'
}
ExitApp
}
}
#include tray.ahk