AutoHotkey is a free, open source macro-creation and automation software utility that allows users to automate repetitive tasks. It is driven by a custom scripting language that is aimed specifically at providing keyboard shortcuts, otherwise known as hotkeys.
AutoHotkey_H v2 started as a fork of AutoHotkey_L v2, merge branch HotKeyIt/ahkdll-v2.
#UseStdLib
, and automatically load libraries from resources.NULL
, CriticalObject
, Struct
, sizeof
, ObjLoad
and ObjDump
A_ZipCompressionLevel
, specify this value in the last parameter of ZipCreateBuffer
or ZipCreateFile
or ZipRawMemory
.DynaCall
object has Param[index]
property, used to retrieve and set default parameters, the index is the same as the position of the argument when it is called.CryptAES
and Zip functions, parameter Size
is not needed when previous parameter is an Object
with Ptr
and Size
properties.ahkExec(LPTSTR script, DWORD aThreadID = 0)
Inherits the current scope variable when aThreadID is 0
Thread("Terminate", all := false)
Terminate the last or all threads, and the timer is only terminating the currentFileRead
and FileOpen
will detect UTF8-RAW
when no code page is specified.|
instead :
, eg. #include <urldownloadtovar|'http://www.website.com/script.ahk'>
, urldownloadtovar.ahk
is a library in lib folder.OnMessage(..., hwnd)
to Gui.Prototype.OnMessage(Msg, Callback [, AddRemove])
, is similar to Gui.Prototype.OnEvent(...)
v := {'key':val}
IAhkApi
export class for developing AHK bindings for third-party libraries, the header file is ahkapi.h.__thiscall
calling conventions supported by DllCall
and DynaCall
, eg. DllCall(func, params, 'thiscall')
, DynaCall(func, 'ret_type=@params_type')
.Decimal
class, supports arbitrary precision decimal operations, MsgBox Decimal('0.1') + Decimal('0.2') = '0.3'
, lib_mpir is required to compile, the source code of mpirArray.Prototype.Filter(callback: (value [, index]) => Boolean) => Array
Array.Prototype.FindIndex(callback: (value [, index]) => Boolean, start_index := 1) => Integer
, if start_index
less than 0 then reverse lookupArray.Prototype.IndexOf(val_to_find, start_index := 1) => Integer
Array.Prototype.Join(separator := ',') => String
Array.Prototype.Map(callback: (value [, index]) => Any) => Array
Array.Prototype.Sort(callback?: (a, b) => Integer) => $this
, sort in place and return and the default is random sortGuiControl.Prototype.OnMessage(Msg, Callback [, AddRemove])
, and Gui.Prototype.OnMessage(Msg, Callback [, AddRemove])
, the parameter of the callback has changed, Callback(GuiObj, wParam, lParam, Msg)
, A_EventInfo
is the message posted time.Object.Prototype.__Item[Prop]
, it's same as Obj.%Prop%
Object.Prototype.Get(Prop [, Default])
u8str
(utf8 string) in DllCall and us
in DynaCallProgID: AutoHotkey2.Script
CLSID : {934B0E6A-9B50-4248-884B-BE5A9BC66B39}
The methods and properties exposed by the Lib object are defined in ahklib.idl, in the IAutoHotkeyLib
interface.
AutoHotkey is developed with Microsoft Visual Studio Community 2022, which is a free download from Microsoft.
The project is configured in a way that allows building with Visual Studio 2012 or later, but only the 2022 toolset is regularly tested. Some newer C++ language features are used and therefore a later version of the compiler might be required.
AutoHotkey v2 can also be built and debugged in VS Code.
Requirements:
AutoHotkeyx.vcxproj contains several combinations of build configurations. The main configurations are:
Secondary configurations are:
AutoHotkeyx.vcxproj includes the following Platforms:
AutoHotkey supports Windows XP with or without service packs and Windows 2000 via an asm patch (win2kcompat.asm). Support may be removed if maintaining it becomes non-trivial. Older versions are not supported.