since it looks like we're posting headers, heres mine:
most scripts:
Code: Select all
;<scriptname>
;Version: 1.0
;Author: KuroiLight/klomb
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;global script_conditional_param := "ahk_exe explorer.exe"
#Include %A_ScriptDIr%\includes\CommonCode.ahk
;#NoTrayIcon
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<init code>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
return
CommonCode.ahk
Code: Select all
;Common Code Library
;Version: -|-
;Author: KuroiLight/klomb
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#NoEnv
#KeyHistory 0
#SingleInstance, force
#Persistent
DetectHiddenWindows, On
ListLines, Off
SetTitleMatchMode, 2
SetWorkingDir, %A_ScriptDir%
CoordMode, Pixel, Screen
CoordMode, ToolTip, Screen
CoordMode, Mouse, Screen
Gui, +OwnDialogs
SetScriptTimeSlice(1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
global A_ScriptNameNoExt := RegExReplace(A_ScriptName, "iDU)^(.*)\.(ahk|exe)$", "$1")
global A_SystemDriveLetter := SubStr(A_WinDir, 1, 1)
global A_UserDownloads := A_SystemDriveLetter . ":\Users\" . A_UserName . "\Downloads"
global A_ScriptPID := DllCall("GetCurrentProcessId")
global EXT_SCRIPT := 0x9501, EXT_RESPOND := 0x9502, WM_COPYDATA := 0x004A
global WM_WTSSESSION_CHANGE := 0x2b1, WTS_SESSION_LOCK := 0x7, WTS_SESSION_UNLOCK := 0x8, WM_QUERYENDSESSION := 0x11, WM_CLOSE := 0x0010
global A_ScriptStartTick := A_TickCount, A_ScriptStartDate := A_Now
OnMessage(WM_QUERYENDSESSION, "WM_CLOSE_MSGS")
OnMessage(WM_CLOSE, "WM_CLOSE_MSGS")
WM_CLOSE_MSGS(wParam, lParam) {
ExitApp, 0
}
argn = %0%
Loop %argn%
arg%A_Index% := %A_Index%
conditional_exit() {
if(script_conditional_param)
if(!WinExist(script_conditional_param))
ExitApp, 0
}
if(script_conditional_param)
SetTimer, conditional_exit, 500
;884 more lines...