-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrayApplet.ahk
188 lines (164 loc) · 7.42 KB
/
TrayApplet.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
; updated for v0.8.7 HeartyHampster
; ===================================================================================
; Startup Code
; ===================================================================================
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#Persistent
#SingleInstance
#include, data\tf.ahk
; ===================================================================================
; Variable check and data loading
; ===================================================================================
Run, %A_ScriptDir%/SMHotKey/SMHotKey.exe
run, splashscreen\SplashScreen.exe
; ===================================================================================
; Tray Menu
; ===================================================================================
Menu, WhosCallingMenu, Add, Activated ; adds the activated menu item
Menu, WhosCallingMenu, Add, About ; adds the about menu item
Menu, WhosCallingMenu, Add, Settings
Menu, SMHotKeyMenu, Add, SMHKHelp
Menu, SMHotKeyMenu, Add, SMHKAbout
Menu, Tray, Icon, media\Logo.ico, 1 ; adds the logo
Menu, Tray, NoStandard, ; removes the standard AHK menu items
Menu, Tray, Add, WhosCalling, :WhosCallingMenu ; makes a submenu for whoscalling
Menu, Tray, Add, SMHotKey, :SMHotKeyMenu ; makes a submenu for whoscalling
Menu, Tray, Add, Exit ; add an exit button
;iniread for the settings.ini file to check if the app has been activated
IniRead, ActivatedStatus, data\settings.ini, appdata, AuthenticationToken
If ActivatedStatus = 0
{
Menu, WhosCallingMenu, Rename, Activated, Not Activated
Menu, Tray, Tip , Not Activated
}
else
{
Menu, WhosCallingMenu, Disable, Activated
Menu, Tray, Tip , Whos Calling
}
return
SMHKHelp:
SMHotKeyHelpFunction()
return
SMHKAbout:
SMHotKeyAboutPage()
return
SMHotKeyHelpFunction()
{
Gui, 3:New,, Help Box,
Gui, 3:Font, s10, Verdana
Gui, 3:Add, Text,, Win+Z - Initials and CurrentDate.
Gui, 3:Add, Text,, Ctrl+Shift+Z - CurrentDate.
Gui, 3:Add, Text,, Ctrl+Shift+C - Ultra Copy
Gui, 3:Add, Text,, Ctrl+Shift+V - Ultra Paste
Gui, 3:Add, Text,, Ctrl+Alt+V - Use on the CRM Onboarding Page, to auto fill data.
Gui, 3:Add, Text,, Ctrl+Shift+F1 or F2 or F3 - Allows you to save up to 3 banks of text.
Gui, 3:Add, Text,, Ctrl+Shift+F12 - Change USER initials.
Gui, 3:Add, Text,, Ctrl+Shift+0 - Types the current date and time DD-MM-YY HH:MM
Gui, 3:Add, Text,, Ctrl+F7 - Select all items, delete them, then move back one folder.
Gui, 3:Add, Button, w80, &OK
Gui, 3:Show,, Shortcuts
return
}
SMHotKeyAboutPage()
{
IniRead, SMVersion, SMHotKey\data.ini, Version, SMVersion ; Reads the SMVersion value from the data.ini
IniRead, Author, SMHotKey\data.ini, Version, Author ; Reads the Author value from the data.ini
IniRead, Updated, SMHotKey\data.ini, Version, Updated ; Reads the Creation value from the data.ini
IniRead, Contact, SMHotKey\data.ini, Version, Contact ; Reads the Contact value from the data.ini
IniRead, Email, SMHotKey\data.ini, Version, Email ; Reads the Email Value from the data.ini
Gui, 4:Add, Picture, x12 y9 w150 h150 , SMHotKey\splash.png
Gui, 4:Font, s14, Verdana
Gui, 4:Add, Text, x172 y49 w190 h70 +Left, Sound Marketing Account Manager Hotkey Application
Gui, 4:Font, s6, Verdana
Gui, 4:Add, Text, x12 y249 w140 h10 +Left, Software version %SMVersion%
Gui, 4:Font, s9, Verdana
Gui, 4:Add, Text, x12 y169 w190 h20 +Left, Created by %Author%
Gui, 4:Add, Text, x212 y169 w180 h20 +Left, Updated on %Updated%
Gui, 4:Add, Text, x12 y199 w190 h20 +Left, Phone: %Contact%
Gui, 4:Add, Text, x212 y199 w180 h20 +Left, Email: %Email%
Gui, 4:Add, Button, x292 y229 w100 h30 , &OK
Gui, 4:Show, x127 y87 h276 w410, SMHotKey About
Return
}
; ===================================================================================
; About Gui
; ===================================================================================
About:
Gui, 1:Font, s9, Segoe UI
Gui, 1:Add, Button, x283 y194 w47 h23, &OK
Gui, 1:Add, Picture, x113 y2 w120 h120, media\Logo.png
Gui, 1:Font
Gui, 1:Font, s20, Lucida Console
Gui, 1:Add, Text, x59 y126 w232 h39 +0x200, Who's Calling?
Gui, 1:Font
Gui, 1:Font, s9, Segoe UI
Gui, 1:Add, Text, x6 y167 w327 h23 +0x200, A custom 3CX and Quickbase telephone number search tool
Gui, 1:Show, w337 h223, About
Return
ButtonOK:
2ButtonOK:
3ButtonOK:
4ButtonOK:
GuiEscape:
GuiClose:
Gui, 1: Destroy
Gui, 2: Destroy
Gui, 3: Destroy
Gui, 4: Destroy
return
; ===================================================================================
; Activated Gui
; ===================================================================================
Activated:
Gui, 2:-MinimizeBox -MaximizeBox
Gui, 2:Font, s9, Segoe UI
Gui, 2:Add, Picture, x64 y0 w60 h60, media\Logo.png
Gui, 2:Font
Gui, 2:Font, s14, Lucida Console
Gui, 2:Add, Text, x10 y63 w231 h40 +0x200, Activation Tool
Gui, 2:Font
Gui, 2:Font, s9, Segoe UI
Gui, 2:Add, Edit, hWndLicenseKey x7 y124 w173 h21
SendMessage 0x1501, 1, "Enter your License Key",, ahk_id %LicenseKey% ; EM_SETCUEBANNER
Gui, 2:Add, GroupBox, x2 y106 w183 h48, License Key
Gui, 2:Add, Button, x98 y160 w80 h23, Verify
Gui, 2:Add, Button, x12 y160 w80 h23, Cancel
Gui, 2:Show, w189 h188, Activation Tool
Return
2ButtonCancel:
Gui, 2:Hide
return
2ButtonVerify:
ControlGetText, LicenseKey, Edit1
if LicenseKey in 23T5Y-4JRHG-PA4SR-M8FWY,24A4X-J7ZD5-HFUYX-THDEA,257S9-FDSU3-Z2BHA-A7NKL,25TFJ-PP4D6-GMZB8-DESW3,26CPV-JGY4Z-E25WD-8ZXET,287LT-QZYLJ-DCJ7U-9AJS8,28T7U-RPDU5-8VP6P-TT7YW,29FNX-JYQTU-TNXF7-HJV2Q,29ZSG-B28BB-ZBUAU-XSE3D,2A3EN-WBW7V-9S9JS-RLNUT,2AYSMFD5M5QMJPXASPY5,2BRWQ8T9SV8FUPJ27M7G,2BZU78HPR2LTNPNRDXVL,2CNRQUBKLH5C96X5SA7S,2D8NFRYDGBVREBBFSNFH,2DSU65FZJ5QAVVZ5ZDFK,2END2T3CMZETF26BL5X3,2F8HZQXUASEU7FHX5TSN,2HFE67PNC5S5K3A8MVE7,2HP334QFLS7P4UF2FU8Q,2LH3YW7N579NRQ6HUJBC,2RYF4P6TJPNWR5RWBR9E,2SS9D3YQUL4S5C67PH83,2SW5JSZVQHE8JX6MEXFQ,2SXD495CS3HMTCU6HLTB,2SXS233KLQTPNTB3UW3X,2TL5H9D7LNZNWMBDTPZK,2TZFP5ZQSW8ZZTV32NXS,2UHTTTL6HN6RBFMVV4WJ
{
IniWrite, 1, data\settings.ini, appdata, AuthenticationToken
IniWrite, %LicenseKey%, data\settings.ini, appdata, ActivationKey
MsgBox, LICENSE KEY ACCEPTED`n"Who's Calling" will now restart and `nactivate the 3CX Windows App link.
Reload
}
else
{
MsgBox, Invalid License Key. `nPlease check and reenter your key.
return
}
return
Settings:
run, settings.exe
return
; ===================================================================================
; Exit Trigger
; ===================================================================================
ExitFromApp() ;
{
Process, Close, SMHotKey.exe
ExitApp, [ ExitCode]
}
; ===================================================================================
; End
; ===================================================================================
exit:
ExitFromApp()