Skip to content

Instantly share code, notes, and snippets.

View hoppfrosch's full-sized avatar

hoppfrosch hoppfrosch

  • Hesse, Germany
View GitHub Profile
@hoppfrosch
hoppfrosch / NbArrElem.ahk
Created September 18, 2012 09:33
PROBLEM: Determine number of Array elements [#ahk #problem
test := GetTimeZones()
ExitApp
GetTimeZones() {
; Taken from: http://www.autohotkey.com/community/viewtopic.php?t=73951
OutputDebug % "**** GetTimeZones START ****"
; Get the "Time Zones" entries from registry
RegRoot := "HKEY_LOCAL_MACHINE"
RegKey := "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
@hoppfrosch
hoppfrosch / JUnit.ahk
Created December 7, 2012 07:54
AHK: JUnit XML output for Yunit-Framework [#ahk #snippet #unittest #function
;############################
; description: Generate JUnit-XML output for Yunit-Framework (https://github.com/Uberi/Yunit)
;
; author: hoppfrosch
; date: 20121207
;############################
class xml{
; Credits:By Maestrith (http://www.autohotkey.com/board/topic/85010-xml-parser/?hl=msxml)
__New(param*){
ref:=param.1,root:=param.2,file:=param.3
@hoppfrosch
hoppfrosch / AHK_version.ahk
Created September 11, 2013 05:18
Determine version of Autohothey #ahk #script #snippet
;shows what version of ahk the user is running
; i think sinkfaze might have come up with this originally (dist. by camerb)
info := "AutoHotkey:`t" "AutoHotkey" ((A_AhkVersion < 1.1) ? " Classic ": ((A_IsDll ? "_H (DLL)":"_L")))
. "`nAHK Version:`t" A_AhkVersion
. "`nUnicode:`t`t" (A_IsUnicode ? "Yes " ((A_PtrSize=8) ? "(64-bit)" : "(32-bit)") : "No")
. "`nOperating System:`t" (!A_OSVersion ? A_OSType : A_OSVersion) " " (A_Is64bitOS ? "(64-bit)" : "(32-bit)")
. "`nAdmin Rights:`t" (A_IsAdmin ? "Yes" : "No")
MsgBox, 68, Support Information, %info%`n`nWould you like to copy this information to the Clipboard?
IfMsgBox Yes
@hoppfrosch
hoppfrosch / WMI_GetProcessInformation.ahk
Created September 26, 2013 06:45
Get information about running processes using WMI #ahk #script #function #wmi #com
; Description: Get Process properties via AHK using WMI
;
; Author: hoppfrosch - 20140206
;
; Credits
; * http://technet.microsoft.com/en-us/library/ee176712.aspx (by MSDN)
; * http://msdn.microsoft.com/en-us/library/windows/desktop/aa394372%28v=vs.85%29.aspx
; * http://http://www.autohotkey.com/board/topic/90385-drei-kleine-fragen (by Rohwedder)
; * http://www.autohotkey.com/board/topic/72817-how-to-obtain-%E2%80%9Cuser-name%E2%80%9D-from-running-processes/#entry465606 (by Lexikos)
PropertyList := "Caption,CommandLine,CreationClassName,CreationDate,CSCreationClassName,CSName,Description,ExecutablePath,"
@hoppfrosch
hoppfrosch / ChristianFeasts.ahk
Last active October 26, 2017 05:03
DateTime - Functionality #ahk #script #function #lib
; Calculating date of christian easter and subsequent christian feasts
;
; The following feasts are calculated:
; * Christian Easter
; * Ash Wednesday
; * Ascension Day
; * Whitsunday
; * Corpus Christi
;
; Author: hoppfrosch @ [email protected]
@hoppfrosch
hoppfrosch / NumifyVersion.ahk
Last active April 4, 2016 06:18
Conversion of a version given as string to a numerical version (to allow version comparison) #ahk #script #function
; Conversion of a version given as string to a numerical version (to allow version comparison)
;
; see: http://www.autohotkey.com/board/topic/62037-conversion-of-version-string-to-number/
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Example: Does current AHK-Version meet my requirements?
; Which version of Autohotkey is required?
versionAHKReq := "1.0.90.0"
vAHKCurr := NumifyVersion(A_AhkVersion)
vAHKReq := NumifyVersion(versionAHKReq)
@hoppfrosch
hoppfrosch / NamedParameters.ahk
Created October 9, 2013 11:21
Named functions parameters using variadic and JSON-Syntax #ahk #script #snippet
; Named parameters for functions
;
; Credits: named parameters by lexikos (http://www.autohotkey.com/board/topic/62504-variadic-functions)
; Note the Brackets around the parameters and the trailing star {...}*!!! (Brackets: JSON - Star: Variadic ...)
Test({WinTitle: "ahk_class Notepad", ExcludeTitle: "Untitled", Cmd: "PID"}*)
Test2({WinTitle: "ahk_class Notepad", ExcludeTitle: "Untitled2", Cmd: "PID2"}*)
; Simple Variadic: All parameters are accesible through prms-Array
Test(prms*) {
@hoppfrosch
hoppfrosch / JSON.ahk
Created November 18, 2013 06:22
JSON Utilities for AutoHotkey #ahk #script #function #json
/*
Title: JSON
JSON Utilities for AutoHotkey
Details:
Internally the ActiveX Control "Windows Script Control " (http://www.microsoft.com/de-de/download/details.aspx?id=1949) is used by those functions
Author:
Compilation by hoppfrosch; Original work by Wicked and tmplinshi
@hoppfrosch
hoppfrosch / CallStack.ahk
Created November 27, 2013 07:45
Get the current AHK-callstack #ahk #script #function #debug
CallStack(deepness = 5, printLines = 1)
{
loop % deepness
{
lvl := -1 - deepness + A_Index
oEx := Exception("", lvl)
oExPrev := Exception("", lvl - 1)
FileReadLine, line, % oEx.file, % oEx.line
if(oEx.What = lvl)
continue
@hoppfrosch
hoppfrosch / WakeUp.ahk
Created January 6, 2014 12:26
AHK wake-up-timer #ahk #script #function
; AHK wake-up-timer
; scheduler provides some of the functions of Window's Task Scheduler or the command line tool "schtasks" as an AHK-script.
; Unlike Windows' Scheduled Tasks this function works with accounts without passwords
;
; Author: boskoop (http://http://www.autohotkey.com/board/topic/10587-wake-up-timer-scheduler-function)
; CONFIGURATION
Year=2006
Month=8 ;1-12
Day=30 ;1-31