list of dll functions with parameter types for DllCall - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=30832
A list of handy dll functions based on DllCall lines found in multiple scripts and libraries, and from functions inside the AutoHotkey source code.
The full list is in the post below.
list of handy dll functions - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 81#p157581
==================================================
LINKS:
list of dll functions with parameter types for DllCall - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=30832
WinApi
https://hotkeyit.github.io/v2/docs/commands/WinApi.htm
GitHub - Lexikos/AutoHotkey_L: AutoHotkey - macro-creation and automation-oriented scripting utility for Windows.
https://github.com/Lexikos/AutoHotkey_L
WinApi, DllCalls & AHK - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=406
==================================================
NOTES:
- For each dll, I used the lowercase version of the dll name. All of the dll files (in the system32 folder) had lowercase names except for 'Magnification' and 'IPHLPAPI'.
- I added 'gui dc' for any function whose definition in https://hotkeyit.github.io/v2/docs/commands/WinApi.htm contained 'hDC' (handle to a device context).
POSSIBLE FUTURE IMPROVEMENTS:
- To add 'deprecated'/'no MSDN page' where appropriate or as separate lists.
- A separate list, AHK commands/functions/variables and related dll functions.
SUFFIXES:
- The suffixes 'A/W' indicate ANSI/wide (Unicode).
- The suffix 'Ex' indicates extended (e.g. RegisterClassEx is similar to RegisterClass, but has more functionality).
CASE DIFFERS (FUNCTION NAMES): 'A' v. 'W' versions:
freeaddrinfo/FreeAddrInfoW
getaddrinfo/GetAddrInfoW
socket/SocketA
socket/SocketW
CASE DIFFERS (FUNCTION NAMES): MSDN V. DLL EXPORT:
(note: in the list above I used the case as exported by the dll, except for the following functions where I used the MSDN version:)
dll: (from MSDN)/(from dll)
msvcrt: strftime/Strftime
user32: EndMenuA/endMenuA
user32: EndMenuW/endMenuW
user32: RegisterShellHookWindow/registerShellHookWindow
user32: SetRect/setRect
user32: ValidateRect/validateRect
ws2_32: accept/Accept
ws2_32: connect/Connect
ws2_32: gethostbyname/GetHostByName
ws2_32: htons/Htons
ws2_32: recv/Recv
ws2_32: select/Select
ws2_32: send/Send
DLLS WITH VARIATIONS:
C:\WINDOWS\system32\atl.dll
C:\WINDOWS\system32\atl100.dll
C:\WINDOWS\system32\atl110.dll
FUNCTIONS THAT APPEAR IN MORE THAN ONE DLL:
GetModuleBaseName: kernel32/psapi
GetProcessImageFileName: kernel32/psapi
==================================================
DLL LISTS: GUI (CREATE WINDOWS/CONTROLS):
- RegisterClassEx
- CreateWindowEx
DLL LISTS: GUI (GET/SET EXTERNAL CONTROL TEXT):
- OpenProcess
- VirtualAllocEx
- WriteProcessMemory
- ReadProcessMemory
- VirtualFreeEx
- CloseHandle
DLL LISTS: DATE/TIME:
- GetLocalTime (time now: local SYSTEMTIME)
- GetSystemTime (time now: UTC SYSTEMTIME)
- (no handy function?) (time now: local FILETIME)
- GetSystemTimeAsFileTime (time now: UTC FILETIME)
- FileTimeToLocalFileTime (convert UTC FILETIME to local FILETIME)
- LocalFileTimeToFileTime (convert local FILETIME to UTC FILETIME)
- SystemTimeToFileTime (convert SYSTEMTIME TO FILETIME)
- FileTimeToSystemTime (convert FILETIME TO SYSTEMTIME)
DLL LISTS: TEXT:
- CryptBinaryToString/CryptStringToBinary (convert between binary data/hex/base64)
- GetPrivateProfileString/WritePrivateProfileString (ini read/write)
- IsTextUnicode ('Bush hid the facts' bug)
- LCMapString (convert between UTF-16 little endian/big endian)
- MultiByteToWideChar/WideCharToMultiByte (convert between ANSI/UTF-8/UTF-16 little endian)
==================================================
Code: Select all
q:: ;list a dll's functions
;[list of 30 dlls from the AutoHotkey_H documentation]
;[28 if remove duplicate of Kernel32 and if remove Winspool]
;list converted to lowercase from: https://hotkeyit.github.io/v2/docs/commands/WinApi.htm
vListDll := "advapi32,comctl32,comdlg32,crypt32,gdi32,gdiplus,glu32,hid,kernel32,ole32,oleacc,oleaut32,opengl32,psapi,rasapi32,rasdlg,rasman,shell32,shlwapi,tapi32,user32,userenv,uxtheme,version,winhttp,wininet,winmm,ws2_32"
;list converted to lowercase from: AHK exe list of memory regions via process hacker
;vListDll := "advapi32,apisetschema,comctl32,comdlg32,cryptbase,dwmapi,gdi32,imm32,kernel32,kernelbase,lpk,msctf,msvcrt,nsi,ntdll,ole32,oleaut32,psapi,rpcrt4,sechost,shell32,shlwapi,sspicli,user32,usp10,uxtheme,version,winmm,wow64,wow64cpu,wow64win,ws2_32,wsock32"
vOutput := ""
VarSetCapacity(vOutput, 1000000*2)
Loop, Parse, vListDll, % ","
{
vTemp := "[" A_LoopField "]`n" DllListExports(A_LoopField ".dll")
vTemp := StrReplace(vTemp, "`n", "`n" A_LoopField "\")
vOutput .= vTemp "`n"
}
vOutput := StrReplace(vOutput, "`n", "`r`n")
Clipboard := vOutput
MsgBox, % "done"
return
;==================================================
;DllListExports() - List of Function exports of a DLL - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=4563
DllListExports( DLL, Hdr := 0 ) { ; By SKAN, http://goo.gl/DsMqa6 , CD:26/Aug/2010 | MD:14/Sep/2014
Local LOADED_IMAGE, nSize := VarSetCapacity( LOADED_IMAGE, 84, 0 ), pMappedAddress, pFileHeader
, pIMGDIR_EN_EXP, IMAGE_DIRECTORY_ENTRY_EXPORT := 0, RVA, VA, LIST := ""
, hModule := DllCall( "LoadLibrary", "Str","ImageHlp.dll", "Ptr" )
If ! DllCall( "ImageHlp\MapAndLoad", "AStr",DLL, "Int",0, "Ptr",&LOADED_IMAGE, "Int",True, "Int",True )
Return
pMappedAddress := NumGet( LOADED_IMAGE, ( A_PtrSize = 4 ) ? 8 : 16 )
pFileHeader := NumGet( LOADED_IMAGE, ( A_PtrSize = 4 ) ? 12 : 24 )
pIMGDIR_EN_EXP := DllCall( "ImageHlp\ImageDirectoryEntryToData", "Ptr",pMappedAddress
, "Int",False, "UShort",IMAGE_DIRECTORY_ENTRY_EXPORT, "PtrP",nSize, "Ptr" )
VA := DllCall( "ImageHlp\ImageRvaToVa", "Ptr",pFileHeader, "Ptr",pMappedAddress, "UInt"
, RVA := NumGet( pIMGDIR_EN_EXP + 12 ), "Ptr",0, "Ptr" )
If ( VA ) {
VarSetCapacity( LIST, nSize, 0 )
Loop % NumGet( pIMGDIR_EN_EXP + 24, "UInt" ) + 1
LIST .= StrGet( Va + StrLen( LIST ), "" ) "`n"
, ( Hdr = 0 and A_Index = 1 and ( Va := Va + StrLen( LIST ) ) ? LIST := "" : "" )
}
DllCall( "ImageHlp\UnMapAndLoad", "Ptr",&LOADED_IMAGE ), DllCall( "FreeLibrary", "Ptr",hModule )
Return RTrim( List, "`n" )
}
Code: Select all
q:: ;an attempt to retrieve custom and dll functions from the AHK source code (these can then be filtered by checking if the functions exist in a dll)
;[download AHK source code from:]
;GitHub - Lexikos/AutoHotkey_L: AutoHotkey - macro-creation and automation-oriented scripting utility for Windows.
;https://github.com/Lexikos/AutoHotkey_L
vDir1 = %A_Desktop%\AutoHotkey_L-master
if !FileExist(vDir1)
{
MsgBox, % "error: folder not found"
return
}
vOutput := ""
VarSetCapacity(vOutput, 1000000*2)
vIsV1 := !!SubStr(1,0)
Loop, Files, % vDir1 "\*.cpp", FR
{
vPath := A_LoopFileFullPath
SplitPath, vPath, vName, vDir, vExt, vNameNoExt, vDrive
FileRead, vText, % vPath
vList := "`r`n!)*,."">;[]:/`t#$%&-+='~|{}<?@\^``"
Loop, Parse, vList
vText := StrReplace(vText, A_LoopField, "")
Loop, Parse, vText, % " "
{
vTemp := A_LoopField
while (SubStr(vTemp, 1, 1) = "(")
vTemp := SubStr(vTemp, 2)
if (vPos := InStr(vTemp, "(", 0, vIsV1-1))
vOutput .= SubStr(vTemp, 1, vPos-1) "`n"
}
}
while InStr(vOutput, "((")
vOutput := StrReplace(vOutput, "((", "(")
vOutput := StrReplace(vOutput, "(`n", "`n")
vOutput := StrReplace(vOutput, "(", "`n")
Sort, vOutput, U
vOutput := StrReplace(vOutput, "`n", "`r`n")
Clipboard := vOutput
MsgBox, % "done"
return