Code: Select all
; =======================================================================================
; Name ..........: Script Name
; Description ...: Script Description
; AHK Version ...: AHK_L 1.1.22.06 (Unicode 32-bit) - September 13, 2015
; Platform ......: Windows 2000+
; Language ......: English (en-US)
; Author ........: FirstName LastName <[email protected]>
; =======================================================================================
; Changelog =============================================================================
; Legend: (+) NEW, (*) CHANGED, (!) FIXED
; ---------------------------------------------------------------------------------------
; YYYY-MM-DD FirstName LastName <[email protected]>
; + Change Description
; ---------------------------------------------------------------------------------------
; YYYY-MM-DD FirstName LastName <[email protected]>
; + Change Description
; =======================================================================================
; Global ================================================================================
#SingleInstance, Force ; Allow only one running instance of script
#Persistent ; Keep script permanently running until terminated
#NoEnv ; Avoid checking empty variables to see if they are environment variables
#Warn ; Enable warnings to assist with detecting common errors
;#NoTrayIcon ; Disable the tray icon of the script
SendMode, Input ; Recommended for new scripts due to its superior speed and reliability
SetWorkingDir, %A_ScriptDir% ; Change the working directory of the script
SetBatchLines, -1 ; Run script at maximum speed
OnExit, ExitSub ; Run a subroutine or function automatically when the script exits
; =======================================================================================
; Script ================================================================================
Return ; End automatic execution
; =======================================================================================
; Labels ================================================================================
MenuHandler:
MsgBox, You selected %A_ThisMenuItem% from menu %A_ThisMenu%.
Return
GuiEscape:
GuiClose:
ExitSub:
ExitApp ; Terminate the script unconditionally
Return
; =======================================================================================
; Functions =============================================================================
GUIMain()
{
Static GUICreate := GUIMain()
Global
GUIWidth := 600, GUIHeight := 400
Menu, Tray, Icon, Shell32.dll, 174 ; Change the tray icon
Menu, Tray, Tip, Script Name ; Change the tooltip of the tray icon
Menu, Tray, NoStandard ; Remove all standard tray menu items
Menu, Tray, Add, Exit, ExitSub
Gui, +LastFound -Resize
;Gui, Color, FFFFFF
Gui, Margin, 10, 10
Gui, Add, Button, % " x" 10 " y" 10 " w" 73 " h" 26, Button1
Gui, Show, % " w" GUIWidth " h" GUIHeight, Application
Return
}
; =======================================================================================