WinApi, DllCalls & AHK

Helpful script writing tricks and HowTo's
User avatar
jNizM
Posts: 2241
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

WinApi, DllCalls & AHK

24 Oct 2013, 07:52

AutoHotkey, WinAPI & DllCall's

[>>> GitHub AHK, DllCall's & WinAPI <<<]

Clipboard Functions
- CloseClipboard
- EmptyClipboard
- OpenClipboard

Cursor Functions
- GetCursorInfo
- GetCursorPos
- GetPhysicalCursorPos
- SetCursorPos
- SetPhysicalCursorPos

Directory Management Functions
- CreateDirectory
- RemoveDirectory
- SetCurrentDirectory

Disk Management Functions
- GetDiskFreeSpace
- GetDiskFreeSpaceEx

Error Handling Functions
- Beep
- FormatMessage
- GetLastError

File Management Functions
- CopyFile
- DeleteFile
- GetFileAttributes
- GetFileSize
- GetFileSizeEx
- GetTempPath
- MoveFile
- MoveFileEx

IP Helper Functions
- GetIpStatistics
- GetIpStatisticsEx
- GetTcpStatistics
- GetTcpStatisticsEx
- GetUdpStatistics
- GetUdpStatisticsEx

Keyboard Input Functions
- BlockInput
- GetKBCodePage
- GetKeyboardLayout

Memory Management Functions
- GetPhysicallyInstalledSystemMemory
- GlobalMemoryStatusEx

Mouse Input Functions
- ClipCursor
- GetCapture
- GetDoubleClickTime
- ReleaseCapture
- SetDoubleClickTime
- SwapMouseButton

Multimedia Functions
- timeGetTime

National Language Support Functions
- GetDurationFormat

Process and Thread Functions
- GetActiveProcessorCount
- GetActiveProcessorGroupCount
- GetCommandLine
- GetCurrentProcess
- GetCurrentProcessId
- GetCurrentProcessorNumber
- GetCurrentThread
- GetCurrentThreadId
- GetMaximumProcessorCount
- GetMaximumProcessorGroupCount
- GetProcessVersion
- Sleep
- SleepEx

PSAPI Functions
- GetModuleFileNameEx
- GetProcessMemoryInfo

String Functions
- CharLower
- CharLowerBuff
- CharUpper
- CharUpperBuff

System Information Functions
- GetComputerName
- GetProductInfo
- GetSystemDirectory
- GetSystemRegistryQuota
- GetSystemWindowsDirectory
- GetSystemWow64Directory
- GetUserName
- GetUserNameEx
- GetVersion
- GetVersionEx
- GetWindowsDirectory
- QueryPerformanceCounter
- QueryPerformanceFrequency

System Shutdown Functions
- LockWorkStation

Time Functions
- GetLocalTime
- GetSystemTime
- GetTickCount
- GetTickCount64
- SetLocalTime
- SetSystemTime

Volume Management Functions
- GetDriveType

Others
- ZwDelayExecution



AutoHotkey-Doc Links
- DllCall() | Script Compatibility
- VarSetCapacity() | Script Compatibility
- NumPut() | NumGet() | Script Compatibility
- Script Compatibility - Pointer Size



MSDN Links:
- Windows API Index
- Windows Data Types
- Data Type Ranges

Useful Links:
- WinApi_List_of_Functions (by HotKeyIt)
- Windows_Data_Types (translated by just me)
- Tutorial - Low-Level Programmierung (Windows-API) (in german by Bentschi)

- Accessing Windows API (by maul-esel)
- Structures (by maul-esel)
- Windows 8 DLL File Information
- Windows 7 DLL File Information
- Windows XP DLL File Information
- ...tba



Useful Tools:
- PeStudio
- DLL Export Viewer by NirSoft
- GDIView by NirSoft (View GDI handles/resources list and detect GDI leaks)
- DLL UnInjector by novirusthanks
- Handle Tracer by novirusthanks
- Kernel Mode Drivers Manager by novirusthanks
- NPE File Analyzer by novirusthanks
- Ring3 API Hook Scanner by novirusthanks
- WriteProcessMemory Monitor by novirusthanks
- ...tba
Last edited by jNizM on 11 Mar 2015, 04:37, edited 41 times in total.
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
User avatar
nnnik
Posts: 2125
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: WinApi, DllCalls & AHK

28 Oct 2013, 02:36

Is this a place to collect many WinAPI functions like the Com obj documentation?
Recommends AHK Studio
User avatar
jNizM
Posts: 2241
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: WinApi, DllCalls & AHK

26 Nov 2013, 10:12

update:
- now on github
- new links
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
User avatar
nnnik
Posts: 2125
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: WinApi, DllCalls & AHK

26 Nov 2013, 11:14

I'll add the following types of Memory Managment Functions:
  1. Heap
  2. Vitual
  3. Local
  4. Global
Recommends AHK Studio
User avatar
jNizM
Posts: 2241
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: WinApi, DllCalls & AHK

27 Nov 2013, 02:58

update:
Add Memory Management Functions \ GlobalMemoryStatusEx
Add System Information Functions \ GetVersion
Add System Information Functions \ GetVersionEx
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
User avatar
jNizM
Posts: 2241
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: WinApi, DllCalls & AHK

28 Nov 2013, 09:00

update:
Add IP Helper Functions \ GetIpStatistics
Add IP Helper Functions \ GetIpStatisticsEx
Add IP Helper Functions \ GetTcpStatistics
Add IP Helper Functions \ GetTcpStatisticsEx
Add IP Helper Functions \ GetUdpStatistics
Add IP Helper Functions \ GetUdpStatisticsEx
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
User avatar
nnnik
Posts: 2125
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: WinApi, DllCalls & AHK

28 Nov 2013, 09:58

I pulled a request.
Recommends AHK Studio
User avatar
joedf
Posts: 5745
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: WinApi, DllCalls & AHK

01 Dec 2013, 20:41

Also, add this into the Tools list: http://www.winitor.com/
the Excellent, absolutely free, PeStudio :)
User avatar
jNizM
Posts: 2241
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: WinApi, DllCalls & AHK

02 Dec 2013, 03:48

update:
Update Others \ ZwDelayExecution
Add Clipboard Functions \ CloseClipboard
Add Clipboard Functions \ EmptyClipboard
Add Clipboard Functions \ OpenClipboard
Add Cursor Functions \ GetCursorInfo
Add Cursor Functions \ GetCursorPos
Add Cursor Functions \ GetPhysicalCursorPos
Add Cursor Functions \ SetCursorPos
Add Cursor Functions \ SetPhysicalCursorPos
Add Process and Thread Functions \ GetCurrentThreadId

@nnnik:
in the next few days

@joedf:
thx and added
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
User avatar
jNizM
Posts: 2241
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: WinApi, DllCalls & AHK

02 Dec 2013, 08:54

update:
Add Time Functions \ GetLocalTime
Add Time Functions \ GetSystemTime
Add Time Functions \ SetLocalTime
Add Time Functions \ SetSystemTime
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
User avatar
jNizM
Posts: 2241
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: WinApi, DllCalls & AHK

03 Dec 2013, 02:36

update:
Add Process and Thread Functions \ GetActiveProcessorCount
Add Process and Thread Functions \ GetActiveProcessorGroupCount
Add Process and Thread Functions \ GetCommandLine
Add Process and Thread Functions \ GetCurrentProcess
Add Process and Thread Functions \ GetCurrentProcessorNumber
Add Process and Thread Functions \ GetCurrentThread
Add Process and Thread Functions \ GetMaximumProcessorCount
Add Process and Thread Functions \ GetMaximumProcessorGroupCount
Add Process and Thread Functions \ GetProcessVersion
Add PSAPI Functions \ GetProcessMemoryInfo
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
User avatar
jNizM
Posts: 2241
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: WinApi, DllCalls & AHK

03 Dec 2013, 08:46

update:
Add Error Handling Functions \ Beep
Add File Management Functions \ CopyFile
Add File Management Functions \ MoveFile
Add File Management Functions \ MoveFileEx
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
User avatar
SKAN
Posts: 309
Joined: 29 Sep 2013, 16:58

Re: WinApi, DllCalls & AHK

03 Dec 2013, 08:59

jNizM wrote:update:
Add Error Handling Functions \ Beep


You need to fix the following link
https://github.com/jNizM/AHK_DllCall_WinAPI/blob/master/src/Error%20Handling%20Functions/Beep.ahk
BTW, that would not work in desired manner in OS greater than Win XP.
User avatar
jNizM
Posts: 2241
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: WinApi, DllCalls & AHK

04 Dec 2013, 02:11

Link fixed.. thx SKAN
I know. Windows7 used the sound card for beep.
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
User avatar
SKAN
Posts: 309
Joined: 29 Sep 2013, 16:58

Re: WinApi, DllCalls & AHK

04 Dec 2013, 04:23

jNizM wrote:I know. Windows7 used the sound card for beep.


Thought so. :)

BTW, I replaced "C:\Windows\System32\drivers\beep.sys" Win7 x86 with a borrowed beep.sys from WinXP-SP3 x86 and I am
*Beeping* happy now!
Ofcourse, Win 7 would not let me replace any driver unless I Take Ownership of it.
User avatar
jNizM
Posts: 2241
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: WinApi, DllCalls & AHK

04 Dec 2013, 05:09

And for Windows 7 x64?
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
User avatar
SKAN
Posts: 309
Joined: 29 Sep 2013, 16:58

Re: WinApi, DllCalls & AHK

04 Dec 2013, 05:19

jNizM wrote:And for Windows 7 x64?


It is the same procedure except the beep.sys has to be from XP-SP3 x64 and the driver location will be different, I believe.
User avatar
jNizM
Posts: 2241
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: WinApi, DllCalls & AHK

09 Dec 2013, 03:37

update:
Add Keyboard Input Functions \ BlockInput
Add Keyboard Input Functions \ GetKBCodePage
Add Keyboard Input Functions \ GetKeyboardLayout
Add Mouse Input Functions \ GetCapture
Add Mouse Input Functions \ GetDoubleClickTime
Add Mouse Input Functions \ ReleaseCapture
Add Mouse Input Functions \ SetDoubleClickTime
Add Mouse Input Functions \ SwapMouseButton
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
Flow Snake
Posts: 11
Joined: 29 Sep 2013, 16:48
Location: The Kindom Of Sweden

Re: WinApi, DllCalls & AHK

03 Jan 2014, 00:25

I love it jNizM :D
Image
User avatar
joedf
Posts: 5745
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: WinApi, DllCalls & AHK

03 Jan 2014, 02:14

Nice signature haha

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 5 guests