AHK-WINAPI Table
A B C D E F G H I K L M N O P R S T U V W
AutoHotkeyWindows API or C FunctionAdditional Information
A_AhkPathGetModuleFileName
A_AppDataSHGetFolderPathCSIDL_APPDATA
A_AppDataCommonSHGetFolderPathCSIDL_COMMON_APPDATA
A_Args__argc and __targv
A_CaretX/YGetWindowThreadProcessId + GetGUIThreadInfoGUITHREADINFO.rcCaret left (x) and top (y).
A_ComputerNameGetComputerName
A_ComSpecGetEnvironmentVariablecomspec
A_CursorGetCursorInfoLoad all system cursors with LoadCursor and compare each one with CURSORINFO.hCursor
A_DD / A_MDayGetLocalTime_stprintf(Buf, _T("%02d"), SYSTEMTIME.wDay);
A_DDDD / A_DDDGetDateFormatGetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, _T("dddd"), Buf, BufSize)
A_DesktopSHGetFolderPathCSIDL_DESKTOPDIRECTORY
A_DesktopCommonSHGetFolderPathCSIDL_COMMON_DESKTOPDIRECTORY
A_GuiWidth / A_GuiHeightSet in WM_SIZEWidth: LOWORD(lParam). Height: HIWORD(lParam).
A_GuiX / A_GuiYGetMessage (message loop)MSG.pt (X and Y coordinates for GuiContextMenu and GuiDropFiles events)
A_HourGetLocalTimeSYSTEMTIME.wHour
A_IPAddress1-4WSAStartup + gethostname + gethostbyname + WSACleanup
A_Is64bitOS#ifdef _WIN64 or IsWow64Process
A_IsAdminOpenSCManager + LockServiceDatabaseAlternatives: IsUserAnAdmin, CheckTokenMembership, GetTokenInformation
A_IsUnicode#ifdef UNICODE
A_LanguageGetSystemDefaultUILanguage
A_LastErrorGetLastError
A_LoopFile...See Loop (Files and Folders)
A_LoopReg...See Loop (Registry)
A_MinGetLocalTimeSYSTEMTIME.wMinute
A_MM/A_MonGetLocalTimeSYSTEMTIME.wMonth
A_MMMM/A_MMMGetDateFormatGetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, _T("MMMM"), Buf, BufSize)
A_MSecGetLocalTime_stprintf(aBuf, _T("%03d"), SYSTEMTIME.wMilliseconds);
A_MyDocumentsSHGetFolderPathCSIDL_MYDOCUMENTS
A_NowGetLocalTimeThe time string from a SYSTEMTIME structure is formated with _stprintf.
A_NowUTCGetSystemTime
A_OSTypeRtlGetVersionOSVERSIONINFOW.dwPlatformId returns VER_PLATFORM_WIN32_NT if the OS is NT-based.
A_OSVersionRtlGetVersionChecks OSVERSIONINFOW dwMajorVersion and dwMinorVersion
A_ProgramFilesSHGetFolderPathCSIDL_PROGRAM_FILES
A_ProgramsSHGetFolderPathCSIDL_PROGRAMS
A_ProgramsCommonSHGetFolderPathCSIDL_COMMON_PROGRAMS
A_PtrSizesizeof(void *)
A_SecGetLocalTimeSYSTEMTIME.wSecond
A_ScreenDPIGetDeviceCapsGetDeviceCaps(hdc, LOGPIXELSX);
A_ScreenHeightGetSystemMetricsSM_CYSCREEN
A_ScreenWidthGetSystemMetricsSM_CXSCREEN
A_StartMenuSHGetFolderPathCSIDL_STARTMENU
A_StartMenuCommonSHGetFolderPathCSIDL_COMMON_STARTMENU
A_StartupSHGetFolderPathCSIDL_STARTUP
A_StartupCommonSHGetFolderPathCSIDL_COMMON_STARTUP
A_TempGetTempPath
A_TickCountGetTickCount
A_TimeIdleGetLastInputInfoGetTickCount() - LASTINPUTINFO.dwTime
A_UserNameGetUserName
A_WDayGetLocalTimeSYSTEMTIME.wDayOfWeek + 1
A_WinDirGetWindowsDirectory
A_WorkingDirGetCurrentDirectory
A_YDay
A_Year/A_YYYYGetLocalTimeSYSTEMTIME.wYear
A_YWeek
AbsqmathFabs (qmath.h, assembly code)Alternative: abs (stdlib.h)
AcosqmathAcos (qmath.h, assembly code)Alternative: acos (math.h)
ASinqmathAsin (qmath.h, assembly code)Alternative: asin (math.h)
ATanqmathAtan (qmath.h, assembly code)Alternative: atan (math.h)
BlockInputInvolves keyboard and mouse hooking.
CeilqmathCeil (qmath.h, assembly code)Alternative: ceil (math.h)
Chrint to LPTSTR
ClipboardGet: IsClipboardFormatAvailable + OpenClipboard + GetClipboardData + GlobalLock + _tcscpy or DragQueryFile (if CF_HDROP) + GlobalUnlock + CloseClipboard
Set: GlobalAlloc + GlobalLock + tcslcpy + EmptyClipboard + GlobalUnlock + GlobalFree + SetClipboardData + CloseClipboard
ClipboardAllGet: OpenClipboard + EnumClipboardFormats + GetClipboardFormatName (for unregistered formats) + GetClipboardData...
Set: OpenClipboard + EmptyClipboard + GlobalAlloc + GlobalLock + memcpy + GlobalUnlock + SetClipboardData + CloseClipboard
ClipWaitCountClipboardFormats or IsClipboardFormatAvailableThe sleep duration is checked with GetTickCount in a for-loop.
ComObjCreateCoCreateInstance
Control AddComboBox: CB_ADDSTRING. ListBox: LB_ADDSTRING
Control Check / UncheckBM_GETCHECK + SetActiveWindow + GetWindowRect + WM_LBUTTONDOWN + WM_LBUTTONUPThread input: GetWindowThreadProcessId + AttachThreadInput
Control ChooseComboBox: CB_SETCURSEL. ListBox: LB_SETCURSEL or LB_SETSEL (multi-select)Additionally: WM_COMMAND CBN_SELCHANGE and CBN_SELENDOK or LBN_SELCHANGE and LBN_DBLCLK
Control ChooseStringComboBox: CB_SELECTSTRING. ListBox: LB_SELECTSTRING or LB_FINDSTRING (multi-select)Additionally: WM_COMMAND CBN_SELCHANGE and CBN_SELENDOK or LBN_SELCHANGE and LBN_DBLCLK
Control DeleteComboBox: CB_DELETESTRING. ListBox: LB_DELETESTRING
Control EditPasteEM_REPLACESEL
Control Enable / DisableEnableWindow
Control Show / HideShowWindowSW_SHOWNOACTIVATE / SW_HIDE
Control Style / ExStyleGetWindowLong + SetWindowLongGWL_STYLE / GWL_EXSTYLE. May also call InvalidateRect to redraw.
Control Show/HideDropDownCB_SHOWDROPDOWNwParam: TRUE shows the list box, FALSE hides it.
Control TabLeft / TabRightWM_KEYDOWN + WM_KEYUP (PostMessage)lParam: VK_LEFT / VK_RIGHT << 16 | 0x00000001 (for key down), 0xC0000001 (for key up)
ControlClickPostMessageFor a left click: WM_LBUTTONDOWN and WM_LBUTTONUP with MK_LBUTTON as wParam.
ControlFocusSetFocus
ControlGet CheckedBM_GETCHECK
ControlGet ChoiceComboBox: CB_GETCURSEL + CB_GETLBTEXTLEN + CB_GETLBTEXT. ListBox: LB_GETCURSEL + LB_GETTEXTLEN + LB_GETTEXT
ControlGet CurrentColEM_GETSEL + EM_LINEFROMCHAR + for-loop + EM_LINEFROMCHAR
ControlGet CurrentLineEM_LINEFROMCHAR
ControlGet EnabledIsWindowEnabled
ControlGet FindStringComboBox: CB_FINDSTRINGEXACT. ListBox: LB_FINDSTRINGEXACT
ControlGet LineEM_GETLINE
ControlGet LineCountEM_GETLINECOUNT
ControlGet ListComboBox: CB_GETCOUNT + CB_GETLBTEXTLEN + CB_GETLBTEXT in a for-loop. ListBox: LB_GETCOUNT + LB_GETTEXTLEN + LB_GETTEXT in a for-loop
ControlGet List (ListView)LVM_GETITEMCOUNT + LVM_GETHEADER + HDM_GETITEMCOUNT + for-loop: WriteProcessMemory + LVM_GETITEMTEXT + ReadProcessMemory.
Selected / focused: for-loop: LVM_GETNEXTITEM (LVNI_SELECTED / LVNI_FOCUSED)
Allocate interprocess memory: GetWindowThreadProcessId + OpenProcess + VirtualAllocEx for a local LVITEM with UINT (32-bit) or UINT64 (64-bit)
ControlGet List, Count...LVM_GETITEMCOUNT. Selected: LVM_GETSELECTEDCOUNT.
Focused: LVM_GETNEXTITEM (wParam: -1, lParam: LVNI_FOCUSED).
Col: LVM_GETHEADER + HDM_GETITEMCOUNT
ControlGet SelectedEM_GETSEL + WM_GETTEXTLENGTH + malloc + WM_GETTEXT
ControlGet Style / ExStyleGetWindowLongGWL_STYLE / GWL_EXSTYLE
ControlGet TabTCM_GETCURSEL
ControlGet VisibleIsWindowVisible
ControlGetFocusGetGUIThreadInfoGUITHREADINFO.hwndFocus
ControlGetPosGetWindowRectThe coordinates are subtracted from the non-child parent (GetAncestor).
ControlGetTextWM_GETTEXTLENGTH + WM_GETTEXTSendMessageTimeout with the flag SMTO_ABORTIFHUNG.
ControlMoveGetWindowRect + GetParent + ScreenToClient + MoveWindowThe first three functions are needed if either coordinate is unspecified.
ControlSend
ControlSendRaw
ControlSetTextWM_SETTEXT
CosqmathCos (qmath.h, assembly code)Alternative: cos (math.h)
Drive EjectGetDriveType + mciSendString"set cdaudio door %s wait" (%s = "closed" or "open"). Other commands for specific drive letter.
Drive LabelSetVolumeLabel
Drive LockCreateFile + DeviceIoControlIOCTL_STORAGE_MEDIA_REMOVAL, PREVENT_MEDIA_REMOVAL.PreventMediaRemoval
Drive UnlockCreateFile + DeviceIoControlIOCTL_STORAGE_MEDIA_REMOVAL
DriveGet CapacityGetDiskFreeSpaceExlpTotalNumberOfBytes
DriveGet FilesystemGetVolumeInformation
DriveGet LabelGetVolumeInformation or SetVolumeLabel
DriveGet ListGetDriveTypeFor-loop A through Z.
DriveGet SerialGetVolumeInformation
DriveGet StatusGetDiskFreeSpace + GetLastError
DriveGet StatusCDmciSendString"status cdaudio mode" or "open %s type cdaudio alias cd wait shareable"
DriveGet TypeGetDriveType
DriveSpaceFreeGetDiskFreeSpaceExlpFreeBytesAvailable
EnvUpdateWM_SETTINGCHANGETarget: HWND_BROADCAST, lParam: (LPARAM)_T("Environment"), flag: SMTO_BLOCK
ExitAppDestroyWindow + PostQuitMessage + deactivate all hooks
ExpqmathExp (qmath.h, assembly code)Alternative: exp (math.h)
FileAppendSee FileOpen
FileCopyGetFullPathName + CopyFileA do-while loop with FindFirstFile and FindNextFile is performed to operate on multiple files.
FileCopyDirGetFullPathName + GetFileAttributes + CreateDirectory + SHFileOperationSHFILEOPSTRUCT.wFunc = FO_COPY
FileCreateDirGetFileAttributes + CreateDirectoryFileCreateDir recursively creates all needed ancestor directories. GetFileAttributes checks if the directory already exists.
FileCreateShortcutIShellLink interfaceCLSID_ShellLink, IID_IShellLink
FileDeleteDeleteFile
FileExistFindFirstFile or GetFileAttributes
FileGetAttribGetFileAttributes
FileGetShortcutIShellLink interface
FileGetSizeCreateFile + GetFileSizeExAlternative: FindFirstFile nFileSizeHigh << 32 | nFileSizeLow
FileGetTimeFindFirstFile + FileTimeToLocalFileTimeThe time string from a SYSTEMTIME structure is formated with _stprintf.
FileGetVersionGetFileVersionInfo + VerQueryValue
FileInstallCreateFile + FindResource + LoadResource + LockResource + WriteFile + SizeofResource + CloseHandleFileInstall includes the specified file inside the compiled version of the script (this operation is performed by a script compiler, which invokes UpdateResource to add the raw binary data as RC data in the .rsrc section of the PE executable). Later, when the compiled script is run, the files are extracted back out onto the disk.
FileMoveGetFullPathName + MoveFileA do-while loop with FindFirstFile and FindNextFile is performed to operate on multiple files.
FileMoveDirGetFullPathName + GetFileAttributes + SHFileOperationSHFILEOPSTRUCT.wFunc = FO_MOVE (the directory is copied and deleted if source and destination are on different volumes. See FileCopyDir and FileRemoveDir).
FileOpenCreateFile + GetCPInfo + ReadFile (detect UTF-8 and UTF-16 LE BOMs) + WriteFile (write/append) + SetFilePointerEx (append).
Standard streams (stdin/stdout/stderr): GetStdHandle.
CreateFile flags:
dwDesiredAccess: GENERIC_READ (read), GENERIC_WRITE (write), GENERIC_WRITE | GENERIC_READ (append)
dwShareMode: ((aFlags >> 8) & (FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE));
dwCreationDisposition: OPEN_EXISTING (read), CREATE_ALWAYS (write), OPEN_ALWAYS (append)
File.LengthGetFileSizeEx
File.Read
File.Write
File.ReadLine
File.WriteLine
File.ReadNumType
File.WriteNumType
File.RawRead
File.RawWrite
File.SeekSetFilePointerExliDistanceToMove
File.TellSetFilePointerExlpNewFilePointer
File.CloseCloseHandle
FileReadCreateFile + GetFileSize + ReadFile + CloseHandle
FileReadLine
FileRecycleSHFileOperationWith the parameters FO_DELETE and FOF_ALLOWUNDO.
FileRecycleEmptySHEmptyRecycleBin
FileRemoveDirRemoveDirectory or SHFileOperation (FO_DELETE)
FileSelectFileGetOpenFileName or GetSaveFileNameThe working directory is changed as a side-effect. AHK fixes that.
FileSelectFolderSHBrowseForFolder + SHGetPathFromIDList
FileSetAttribSetFileAttributesA do-while loop with FindFirstFile and FindNextFile is performed to operate on multiple files.
FileSetTimeLocalFileTimeToFileTime + CreateFile + SetFileTime
FloorqmathFloor (qmath.h, assembly code)Alternative: floor (cmath.h)
Format_sctprintf ("ULT" options: CharUpper and CharLower)Alternative: innumerous variants of sprintf (_stprintf, StringCchPrintf, etc).
FormatTime
GetKeyStateGetKeyState
Gui Add, (Control Type)CreateWindowExAll controls have the styles WS_CHILD and WS_VISIBLE. Almost all controls have WS_TABSTOP. Specific styles for each control type are described below.
The font is applied with WM_SETFONT.
The initial control text is defined with SetWindowText, except for Tab (TabCtrl_InsertItem), ListView (ListView_InsertColumn), ComboBox/DDL (CB_ADDSTRING) and ListBox (LB_ADDSTRING).
Gui Add, TextCreateWindowEx: Static
Gui Add, LinkCreateWindowEx: SysLink
Gui Add, PictureCreateWindowEx: StaticLoadPicture (internal AHK function), SS_BITMAP or SS_ICON, STM_SETIMAGE
Gui Add, GroupBoxCreateWindowEx: ButtonBS_GROUPBOX
Gui Add, ButtonCreateWindowEx: ButtonDefault button (BS_DEFPUSHBUTTON): DM_SETDEFID and BM_SETSTYLE
Gui Add, CheckBoxCreateWindowEx: ButtonBS_AUTOCHECKBOX or BS_AUTO3STATE. Initial state: BM_SETCHECK.
Gui Add, RadioCreateWindowEx: ButtonBS_AUTORADIOBUTTON. CheckRadioButton or BM_SETCHECK. Styles: BS_AUTORADIOBUTTON | BS_NOTIFY | WS_GROUP (WS_TABSTOP is applied only to the first radio in the group).
Gui Add, ComboBoxCreateWindowEx: ComboboxWS_VSCROLL|CBS_AUTOHSCROLL|CBS_DROPDOWN|CBS_NOINTEGRALHEIGHT
Gui Add, DropDownListCreateWindowEx: ComboboxWS_VSCROLL|CBS_DROPDOWNLIST|CBS_NOINTEGRALHEIGHT
Gui Add, ListboxCreateWindowEx: ListboxWS_VSCROLL|LBS_USETABSTOPS|LBS_NOTIFY, WS_EX_CLIENTEDGE
Gui Add, ListViewCreateWindowEx: WC_LISTVIEW (SysListView32)LVS_SHOWSELALWAYS|LVS_REPORT, WS_EX_CLIENTEDGE, LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP
Gui Add, TreeViewCreateWindowEx: WC_TREEVIEW (SysTreeView32)TVS_SHOWSELALWAYS|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS, WS_EX_CLIENTEDGE
Gui Add, EditCreateWindowEx: EditWS_EX_CLIENTEDGE. Additional operations for some styles/options.
Gui Add, DateTimeCreateWindowEx: DATETIMEPICK_CLASS (SysDateTimePick32)DTS_SHORTDATECENTURYFORMAT
Gui Add, MonthCalCreateWindowEx: MONTHCAL_CLASS (SysMonthCal32)
Gui Add, HotkeyCreateWindowEx: HOTKEY_CLASS (msctls_hotkey32)
Gui Add, UpDownCreateWindowEx: UPDOWN_CLASS (msctls_updown32)UDS_SETBUDDYINT|UDS_ALIGNRIGHT|UDS_AUTOBUDDY|UDS_ARROWKEYS
Gui Add, SliderCreateWindowEx: TRACKBAR_CLASS (msctls_trackbar32)
Gui Add, ProgressCreateWindowEx: PROGRESS_CLASS (msctls_progress32)PBS_SMOOTH
Gui Add, Tab / Tab2 / Tab3CreateWindowEx: WC_TABCONTROL (SysTabControl32)Styles: TCS_MULTILINE|WS_CLIPSIBLINGS. Tab3: CreateDialogIndirect, SetProp "ahk_dlg", EnableThemeDialogTexture, WS_EX_CONTROLPARENT. The Tab3 dialog procedure creates a pattern brush based on a bitmap of the tab dialog's background: GetClientRect + CreateCompatibleDC + CreateCompatibleBitmap + SelectObject + WM_PRINTCLIENT + CreatePatternBrush... SetTextColor + MapWindowPoints + SetBrushOrgEx + SetBkMode
Gui Add, ActiveXAtlAxWinInit + CreateWindowEx: AtlAxWinWS_CLIPSIBLINGS
Gui Add, StatusBarCreateStatusWindowSBARS_SIZEGRIP (if the window is resizable (WS_SIZEBOX)) and SBARS_TOOLTIPS
Gui Cancel/HideShowWindowSW_HIDE
Gui ColorCreateSolidBrush...Alternative: WNDCLASSEX.hbrBackground
Gui DestroyDestroyWindowDestroy icons, bitmaps, brushes, remove the menu (SetMenu), call DragFinish, DestroyAcceleratorTable, etc.
Gui FlashFlashWindow
Gui FontCreateFont...
Gui MenuCreateMenu or CreatePopupMenu + SetMenuInfo + SetMenu + CreateAcceleratorTableMENUINFO.dwStyle = MNS_CHECKORBMP
Gui Minimize / Maximize / RestoreShowWindowSW_MINIMIZE / SW_MAXIMIZE / SW_RESTORE
Gui NewRegisterClassEx + CreateWindowEx + WM_SETICON, parse options, SetWindowText (title), etc WNDCLASSEX style: CS_DBLCLKS, cbWndExtra: DLGWINDOWEXTRA. The window can also be created with "Gui Add" or "Gui Show".
Gui ShowSetWindowText (for title), IsZoomed, IsIconic, IsWindowVisible, AdjustWindowRectEx, GetSystemMetrics, WM_NCCALCSIZE, SystemParametersInfo (SPI_GETWORKAREA), GetWindowRect, GetClientRect, ShowWindow, etc
Gui SubmitSee GuiControlGet (Contents).NoHide skips ShowWindow(mHwnd, SW_HIDE).
GuiCloseWM_CLOSE
GuiContextMenuWM_CONTEXTMENU
GuiControl (Set Text)SetWindowText
GuiControl (CheckBox)BM_SETCHECK
GuiControl (Edit)SetWindowTextLF is converted to CRLF if the control has the style ES_MULTILINE.
GuiControl (DateTime)DateTime_SetSystemtime or DateTime_SetFormat
GuiControl (MonthCal)MonthCal_SetSelRange or MonthCal_SetCurSel
GuiControl (Hotkey)HKM_SETHOTKEY
GuiControl (UpDown)UDM_GETPOS32 or UDM_GETPOS + UDM_SETPOS32 or UDM_SETPOS
GuiControl (Slider)TBM_SETPOS
GuiControl (Progress)PBM_SETPOS or PBM_DELTAPOS
GuiControl (StatusBar)SetWindowTextSets the text of the first part only. See SB_SetText.
GuiControl (Tab)TabCtrl_InsertItem
GuiControl (ComboBox/DDL)CB_ADDSTRING
GuiControl (ListBox)LB_ADDSTRING
GuiControl (Picture)LoadPicture (internal AHK function) + STM_SETIMAGE
GuiControl (Radio)CheckRadioButton or BM_SETCHECK
GuiControl +/-Option
GuiControl ChooseTab: TabCtrl_SetCurSel or TabCtrl_SetCurFocus. ComboBox/DDL: CB_SETCURSEL. ListBox: LB_SETSEL (multiple selection) or LB_SETCURSEL
GuiControl ChooseStringTab: TabCtrl_GetItemCount + TabCtrl_GetItem + _tcscmp or lstrcmpi (to find the tab index by name) + TabCtrl_SetCurSel or TabCtrl_SetCurFocus. ComboBox/DDL: CB_SELECTSTRING. ListBox: LB_FINDSTRING + LB_SETSEL (multiple selection) or LB_SELECTSTRING
GuiControl Enable/DisableEnableWindow
GuiControl FocusSetFocus
GuiControl FontWM_SETFONT. ListView: ListView_SetTextColor. TreeView: TreeView_SetTextColor. DateTime: DateTime_SetMonthCalColor. MonthCal: MonthCal_SetColor. InvalidateRect
GuiControl MoveMoveWindow and (if unspecified coords) GetWindowRect + ScreenToClientAlternative: SetWindowPos
GuiControl MoveDrawThe same as above + GetWindowRect + MapWindowPoints + InvalidateRect
GuiControl Show/HideShowWindowSW_SHOWNOACTIVATE or SW_HIDE
GuiControlGet (Contents)UpDown: UDM_GETPOS32 or UDM_GETPOS. Slider: TBM_GETPOS. Progress: PBM_GETPOS. DateTime: DateTime_GetSystemtime. MonthCal: MonthCal_GetCurSel or MonthCal_GetSelRange. Hotkey: HKM_GETHOTKEY. CheckBox/Radio: BM_GETCHECK. DDL (+AltSubmit: position): CB_GETCURSEL. ComboBox: CB_GETCURSEL + GetWindowText + CB_FINDSTRINGEXACT + CB_GETLBTEXT. ListBox: LB_GETCURSEL + LB_GETTEXTLEN + LB_GETTEXT (single selection) or LB_GETSELCOUNT + LB_GETSELITEMS + for-loop LB_GETTEXT (multiple selection). Tab: TabCtrl_GetCurSel + TabCtrl_GetItem. ActiveX: AtlAxGetControl + QueryInterface etc. Others or "Text" param: GetWindowTextLength + GetWindowText
GuiControlGet FocusGetFocus
GuiControlGet EnabledIsWindowEnabled
GuiControlGet PosGetWindowRect + ScreenToClient
GuiControlGet VisibleIsWindowVisible
GuiDropFilesWM_DROPFILES + DragQueryFileThe window must have WS_EX_ACCEPTFILES (added by AHK). wParam is a handle to an internal Windows structure describing the dropped files.
GuiEscapeWM_KEYDOWN (VK_ESCAPE)
GuiSizeWM_SIZE
HotkeyRegisterHotkeySee also: Keyboard and mouse hook.
HotstringKeyboard hook
IL_AddImageList_AddMasked (bitmaps), ImageList_AddIcon (icons)LoadPicture (AHK internal function) is used to load and determine the type of the file.
IL_CreateImageList_CreateGetSystemMetrics is used to determine width and height. Flags: ILC_MASK | ILC_COLOR32
IL_DeleteImageList_Destroy
IniReadGetPrivateProfileString
IniWriteWritePrivateProfileString
InStrString manipulationCase insensitive comparisson converts the characters to lowercase with CharLower or "char | 0x20". Alternatives: strstr, wcsstr, _tcsstr, etc.
Keyboard and mouse hookSetWindowsHookEx + CallNextHookEx etcWH_KEYBOARD_LL and WH_MOUSE_LL
KeyWaitFor-loop, GetTickCount + GetKeyState or GetAsyncKeyState or (for joystick buttons) joyGetDevCaps + joyGetPosEx
LnqmathLog (qmath.h, assembly code)Alternative: log (Math.h)
LoadPictureExtractIconEx, LoadImage, etc.FindResource, CreateIconFromResourceEx, ExtractIconEx, PrivateExtractIcons, LoadImage, OleLoadPicture...
LogqmathLog10 (qmath.h, assembly code)Alternative: log10 (math.h)
Loop (Files and Folders)FindFirstFile + FindNextFile + FindCloseRecursively.
Loop (Registry)RegOpenKeyEx + RegQueryInfoKey + RegEnumValue + RegEnumKeyEx + RegCloseKeyRecursively.
LV_AddListView_InsertItem
LV_Add / Modify CheckListView_InsertItem / ListView_SetItem + ListView_SetCheckStateLVITEM.state |= 0x1000 (checked) or 0x2000 (unchecked)
LV_Add / Modify ColListView_InsertItem / ListView_SetItemLVITEM.iSubItem
LV_Add / Modify FocusListView_InsertItem / ListView_SetItemLVITEM.state |= LVIS_FOCUSED
LV_Add / Modify IconListView_InsertItem / ListView_SetItemLVITEM.iImage
LV_Add / Modify SelectListView_InsertItem / ListView_SetItemLVITEM.state |= LVIS_SELECTED
LV_DeleteLVM_DELETEITEM or LVM_DELETEALLITEMS
LV_DeleteColListView_DeleteColumn + MoveMemory
LV_GetCount (Items)LVM_GETITEMCOUNT
LV_GetCount ColumnLVM_GETHEADER + HDM_GETITEMCOUNT
LV_GetCount SelectedLVM_GETSELECTEDCOUNT
LV_GetNext (Selected)ListView_GetNextItemLVNI_SELECTED
LV_GetNext CheckedListView_GetItemCount + for-loop + ListView_GetCheckState
LV_GetNext FocusedListView_GetNextItemLVNI_FOCUSED
LV_GetText (Header)LVM_GETCOLUMNLVCOLUMN.pszText, LVCF_TEXT mask
LV_GetText (Row)LVM_GETITEMLVITEM.pszText, LVIF_TEXT mask
LV_InsertListView_InsertItem
LV_InsertColListView_InsertColumn
LV_ModifyListView_SetItem
LV_Modify VisLVM_ENSUREVISIBLE
LV_ModifyCol (no params)ListView_SetColumnWidthFor report mode only (LVS_REPORT). Param: LVSCW_AUTOSIZE.
LV_...Col N (width)ListView_InsertColumn / ListView_SetColumnLVCOLUMN.mask |= LVCF_WIDTH; LVCOLUMN.cx
LV_...Col Auto / AutoHdrListView_SetColumnWidthLVSCW_AUTOSIZE / LVSCW_AUTOSIZE_USEHEADER
LV_...Col IconListView_InsertColumn / ListView_SetColumnLVCOLUMN.fmt |= LVCFMT_IMAGE, LVCOLUMN.iImage
LV_...Col IconRightListView_InsertColumn / ListView_SetColumnLVCOLUMN.fmt |= LVCFMT_BITMAP_ON_RIGHT
LV_...Col (alignment)ListView_InsertColumn / ListView_SetColumnLVCFMT_RIGHT, LVCFMT_LEFT, LVCFMT_CENTER
LV_...Col (set text)ListView_InsertColumn / ListView_SetColumnLVCOLUMN.mask |= LVCF_TEXT;
LV_...Col (sort by type)ListView_InsertColumn / ListView_SetColumnLV_COL_INTEGER, LV_COL_FLOAT, LV_COL_TEXT
LV_...Col (sorting commands)LVM_SORTITEMS or LVM_SORTITEMSEX + LVM_GETITEM + ListView_SetItemStrCmpLogicalW (shlwapi.dll) is used for "Logical" sorting.
LV_...Col (sorting options)ListView_InsertColumn / ListView_SetColumnSorting options: Case, CaseLocale, Desc, Logical, NoSort, Sort, SortDesc, Uni.
LV_SetImageListListView_SetImageListIcon size is determined with ImageList_GetIconSize and GetSystemMetrics(SM_CXSMICON).
Menu ... AddInsertMenuItem + CreatePopupMenu (for submenus) + SetMenuItemInfo (options) + CreateAcceleratorTableMENUITEMINFO.fMask = MIIM_ID | MIIM_FTYPE | MIIM_STRING | MIIM_STATE... (it may also include MIIM_SUBMENU and MIIM_BITMAP)
Menu ... Add (Separator)InsertMenuItemMENUITEMINFO.fType = MFT_SEPARATOR
Menu ... Add +RadioSetMenuItemInfoMENUITEMINFO.fType |= MFT_RADIOCHECK
Menu ... Add +RightSetMenuItemInfoMENUITEMINFO.fType |= MFT_RIGHTJUSTIFY
Menu ... Add +BreakSetMenuItemInfoMENUITEMINFO.fType |= MFT_MENUBREAK
Menu ... Add +BarBreakSetMenuItemInfoMENUITEMINFO.fType |= MFT_MENUBARBREAK
Menu ... Check / UncheckSetMenuItemInfoMENUITEMINFO.fState |= MFS_CHECKED or MFS_UNCHECKED
Menu ... ColorSetMenuInfoMENUINFO.fMask = MIM_BACKGROUND | MIM_APPLYTOSUBMENUS, MENUINFO.hbrBack
Menu ... DefaultSetMenuDefaultItemMakes the menu item bold.
Menu ... DeleteRemoveMenuAdditionally, the icon is destroyed and the menu bar is updated.
Menu ... DeleteAllRemoveMenu (in a for-loop)
Menu ... Enable / DisableSetMenuItemInfoMENUITEMINFO.fState |= MFS_ENABLED or MFS_DISABLED
Menu ... IconInternal AHK functions LoadPicture and IconToBitmap32 + SetMenuItemInfoMENUITEMINFO.hbmpItem (the icon must be a bitmap). To remove the icon, set hbmpItem to NULL.
Menu ... InsertInsertMenuItem
Menu ... RenameSetMenuItemInfoMENUITEMINFO.dwTypeData
Menu ... Show, [X, Y]GetCursorPos + TrackPopupMenuExFlags: TPM_LEFTALIGN | TPM_LEFTBUTTON
Menu Tray, ClickHandled in MainWindowProc (AHK_NOTIFYICON)WM_LBUTTONDOWN or WM_LBUTTONDBLCLK
Menu Tray, IconShell_NotifyIcon, NOTIFYICONDATANIM_ADD, Flags: NIF_MESSAGE | NIF_TIP | NIF_ICON,
NOTIFYICONDATA.uCallbackMessage = AHK_NOTIFYICON
Menu Tray, NoIconShell_NotifyIconNIM_DELETE
Menu Tray, TipShell_NotifyIconNIM_MODIFY, NOTIFYICONDATA.szTip
Min / MaxLoop params, Min ? Val1 < Val2 : Val1 > Val2, etc.AHK source: BIF_MinMax
ModqmathFmod (qmath.h, assembly code)Alternative: modulus operator ("%")
MouseClickmouse_event (move) + GetCursorPos + WindowFromPoint + GetWindowThreadProcessId + WM_NCHITTEST + BringWindowToTop... + mouse_event (mouse button)mouse_event is called twice at the end for "down" and "up" events (a left click involves MOUSEEVENTF_LEFTDOWN and MOUSEEVENTF_LEFTUP).
MouseClickDragmouse_event (move), mouse_event (mouse button down), mouse_event (move), mouse_event (mouse button up)
MouseGetPosGetCursorPos + WindowFromPoint or EnumChildWindows
MouseMovemouse_eventFlags: MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE. The Speed parameter invokes mouse_event in a loop for every calculated intermediary point. Relative coordinates are converted to absolute coordinates.
MsgBoxMessageBoxAlternative: MessageBoxTimeout
NumGet
NumPut
OnMessageMessages are handled in the window procedure.
OrdTBYTE typecasting
OutputDebugOutputDebugString
PixelGetColorGetDC or CreateDC + GetPixel + ReleaseDC or DeleteDC
PixelSearch
Process CloseOpenProcess + TerminateProcess + CloseHandle
Process ExistEnumProcesses + (for process name) EnumProcessModules + GetModuleBaseName + _tsplitpath + _tcscat + _tcsicmp + CloseHandleWithout parameters: GetCurrentProcessId.
Process PriorityOpenProcess + SetPriorityClass + CloseHandle
Process Wait / WaitClosefor (;;) + GetTickCount + "Process Exist"
Randomgenrand_int32 (mt19937ar-cok.cpp)Alternatives: srand(time(NULL)), rand() % (max - min)) + min; CryptGenRandom, RtlRandomEx, rand_s (msvcrt.dll)
Random (NewSeed)init_genrand (mt19937ar-cok.cpp)Alternative: srand
RegDeleteRegOpenKeyEx + RegDeleteKey or RegDeleteValue + RegCloseKeyRecursively: RegEnumKeyEx + RegOpenKeyEx + RegDeleteKey or RegDeleteKeyEx
RegExMatchpcre_compile2 + pcre_fullinfo + pcre_execPCRE library
RegExReplacepcre_compile2 + pcre_fullinfo + pcre_exec...PCRE library
RegReadRegOpenKeyEx + RegQueryValueEx + RegCloseKey
RegWriteRegCreateKeyEx + RegSetValueEx + RegCloseKey
RoundqmathFloor or qmathCeil + qmathPow (qmath.h, assembly code)Alternative: round + pow (for decimal places)
RunCreateProcess or ShellExecuteExShellExecuteEx accepts verbs (edit, explore, find, open, print, properties).
RunAsCreateProcessWithLogonW
SB_SetIconSB_SETICONRetrieves and destroys the old icon (SB_GETICON and DestroyIcon). See also: LoadPicture.
SB_SetPartsSB_SETPARTS
SB_SetTextSB_SETTEXT
SetRegViewKEY_WOW64_64KEY or KEY_WOW64_32KEYFlags for RegCreateKeyEx, RegDeleteKeyEx, RegOpenKeyEx
SetTimer
SetWorkingDirSetCurrentDirectory
ShutdownExitWindowsEx
SinqmathSin (qmath.h, assembly code)Alternative: sin (math.h)
SleepFor-loop + GetTickCount etc (MsgSleep in application.cpp)Alternative: Sleep
Sort
SoundBeepBeep
SoundGet / SetInterfaces: IMMDeviceEnumerator, IAudioEndpointVolume, IMMDevice, IDeviceTopology, IConnector, IPart, IAudioVolumeLevel, IAudioMute.XP: mixerOpen, mixerGetDevCaps, mixerGetLineInfo, mixerGetLineControls, mixerGetControlDetails, mixerSetControlDetails, mixerClose.
SoundGet/SetWaveVolume
SoundPlayPlaySound
SplitPathParsing (_tcsrchr, etc)Alternative: _tsplitpath
SqrtqmathSqrt (qmath.h, assembly code)Alternative: sqrt (math.h)
StatusBarGetTextSB_GETPARTS, SB_GETTEXTLENGTH, SB_GETTEXTMemory is allocated in the remote process with VirtualAllocEx and read with ReadProcessMemory.
StringLowerCharLowerTitle case: For-loop IsCharAlpha + CharUpper or CharLower
StringUpperCharUpper
StrLen_tcslen (string.h)
StrReplace
StrSplitString manipulationAlternative: strtok or _tcstok (string.h)
SubStrString manipulation
SysGetGetSystemMetrics
TanqmathTan (qmath.h, assembly code)Alternative: tan (math.h)
ToolTipCreateWindowEx (tooltips_class32) + ToolTip messagesMessages: TTM_ADDTOOL, TTM_SETMAXTIPWIDTH, TTM_TRACKPOSITION, TTM_TRACKACTIVATE, TTM_UPDATETIPTEXT
Trim / LTrim / RTrimString manipulation
TV_AddTreeView_InsertItemTVINSERTSTRUCT.hInsertAfter = TVI_LAST
TV_Add / Modify BoldTreeView_InsertItem / TreeView_SetItemTVITEM.state |= TVIS_BOLD
TV_Add / Modify CheckTreeView_InsertItem / TreeView_SetItemTVITEM.state |= adding ? 0x2000 (unchecked) : 0x1000 (checked)
TV_Add / Modify ExpandTreeView_InsertItem / TreeView_SetItem or TreeView_ExpandTreeView_Expand flag: TVE_EXPAND. TVITEM.state |= TVIS_EXPANDED
TV_Add / Modify FirstTreeView_InsertItem / TreeView_SetItemTVINSERTSTRUCT.hInsertAfter = TVI_FIRST
TV_Add / Modify IconTreeView_InsertItem / TreeView_SetItemTVITEM.iImage and TVITEM.iSelectedImage, mask |= TVIF_IMAGE|TVIF_SELECTEDIMAGE
TV_Add / Modify SelectTreeView_InsertItem / TreeView_SetItemAdding: TreeView_Select, TVGN_CARET
TV_Add / Modify SortTreeView_InsertItem / TreeView_SortChildrenAdding: TVINSERTSTRUCT.hInsertAfter = TVI_SORT
TV_Add / Modify VisTVM_ENSUREVISIBLE
TV_Add / Modify VisFirstTreeView_Select | TVGN_FIRSTVISIBLE
TV_DeleteTVM_DELETEITEM
TV_Get BoldTVM_GETITEMSTATETVIS_BOLD
TV_Get CheckTVM_GETITEMSTATETVIS_STATEIMAGEMASK result == 0x2000
TV_Get ExpandTVM_GETITEMSTATETVIS_EXPANDED
TV_GetChildTVM_GETNEXTITEMTVGN_CHILD
TV_GetCountTVM_GETCOUNT
TV_GetNextTVM_GETNEXTITEMTVGN_NEXT or TVGN_ROOT (when all parameters are omitted)
TV_GetNext CheckedFor-loop: TreeView_GetChild or TreeView_GetNextSibling + TreeView_GetCheckState
TV_GetParentTVM_GETNEXTITEMTVGN_PARENT
TV_GetPrevTVM_GETNEXTITEMTVGN_PREVIOUS
TV_GetSelectionTVM_GETNEXTITEMTVGN_CARET
TV_GetTextTVM_GETITEMTVITEM.mask = TVIF_TEXT, text = TVITEM.pszText
TV_ModifyTreeView_SetItem
TV_SetImageListTreeView_SetImageList
UrlDownloadToFileInternetOpen + InternetOpenUrl + _tfopen + InternetReadFileExA or InternetReadFile + InternetCloseHandleInternetOpenUrl flags: INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_CACHE_WRITE
VarSetCapacityFillMemoryAlternative: ZeroMemory
WinActivate / WinActivateBottomBringWindowToTop etc
WinActiveGetForegroundWindow
WinCloseWM_CLOSESee also: WinKill.
WinExistIsWindow or EnumWindows
WinGet ControlListHwnd
WinGet ListEnumWindows
WinGet MinMaxIsZoomed or IsIconic
WinGet PIDGetWindowThreadProcessId
WinGet ProcessNameGetModuleBaseName
WinGet ProcessPathGetModuleFileNameEx
WinGet Style / ExStyleGetWindowLongGWL_STYLE / GWL_EXSTYLE
WinGet TransColorGetLayeredWindowAttributespcrKey, if (pdwFlags & LWA_COLORKEY)
WinGet TransparentGetLayeredWindowAttributespbAlpha, if (pdwFlags & LWA_ALPHA)
WinGetActiveStatsGetForegroundWindow + GetWindowTextLength + GetWindowText + GetWindowRect
WinGetActiveTitleGetForegroundWindow + GetWindowTextLength + GetWindowText
WinGetClassGetClassName
WinGetPosGetWindowRect
WinGetTextEnumChildWindows + WM_GETTEXTLENGTH + WM_GETTEXT
WinGetTitleGetWindowTextLength + GetWindowText
WinHideShowWindowAsyncSW_HIDE
WinKillWM_CLOSEOr: GetWindowThreadProcessId + OpenProcess + TerminateProcess + CloseHandle
WinMaximizeShowWindowAsyncSW_MAXIMIZE
WinMenuSelectItemGetMenu or GetSystemMenu + GetMenuItemCount + GetMenuItemID + (recurse if ItemID is 0xFFFFFFFF or -1) GetSubMenu + GetMenuString + PostMessage (WM_COMMAND or WM_SYSCOMMAND)
WinMinimizeShowWindowAsyncSW_MINIMIZE or SW_FORCEMINIMIZE
WinMoveGetWindowRect (for unspecified coords) + MoveWindow
WinRestoreShowWindowAsyncSW_RESTORE
WinSet AlwaysOnTop On / OffSetWindowPosHWND_TOPMOST / HWND_NOTOPMOST.
WinSet AlwaysOnTop ToggleGetWindowLong + SetWindowPosGWL_EXSTYLE, WS_EX_TOPMOST
WinSet Bottom / TopSetWindowPosHWND_BOTTOM / HWND_TOP
WinSet Disable / EnableEnableWindow
WinSet RedrawInvalidateRect
WinSet RegionCreateRectRgn or CreateRoundRectRgn or CreateEllipticRgn or CreatePolygonRgn + SetWindowRgn
WinSet Style / ExStyleGetWindowLong + SetWindowLongGWL_STYLE / GWL_EXSTYLE. May also call SetWindowPos and InvalidateRect to redraw.
WinSet TransColorSetWindowLongGWL_EXSTYLE, WS_EX_LAYERED, LWA_COLORKEY, LWA_ALPHA
WinSet TransparentSetWindowLong + SetLayeredWindowAttributesGWL_EXSTYLE, WS_EX_LAYERED, LWA_ALPHA
WinSetTitleSetWindowText
WinShowShowWindow