WinApi, DllCalls & AHK

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

Re: WinApi, DllCalls & AHK

14 Feb 2014, 03:58

update:
Add Multimedia Functions \ timeGetTime
Fix Time Functions \ GetTickCount
Fix Time Functions \ GetTickCount64
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: WinApi, DllCalls & AHK

24 Feb 2014, 07:31

update:
Add National Language Support Functions \ GetDurationFormat
Add System Information Functions \ GetComputerName
Add System Information Functions \ GetProductInfo
Add System Information Functions \ GetSystemDirectory
Add System Information Functions \ GetSystemRegistryQuota
Add System Information Functions \ GetSystemWindowsDirectory
Add System Information Functions \ GetSystemWow64Directory
Add System Information Functions \ GetUserName
Add System Information Functions \ GetWindowsDirectory
Fix Array-Begin from 0 to 1
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: WinApi, DllCalls & AHK

03 Mar 2014, 06:04

update:
Add String Functions \ CharLower
Add String Functions \ CharLowerBuff
Add String Functions \ CharUpper
Add String Functions \ CharUpperBuff
Fix return (delete , and %)
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: WinApi, DllCalls & AHK

03 Mar 2014, 11:17

COD : UF vs COD : BO
Call of DLL : Undocumented Functions vs Call of Duty : Black Ops
:)
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: WinApi, DllCalls & AHK

05 Mar 2014, 15:32

Here is my contribution : AnimateWindow

Code: Select all

/*
	http://msdn.microsoft.com/library/ms632669

	BOOL WINAPI AnimateWindow(
	  _In_  HWND hwnd,
	  _In_  DWORD dwTime,
	  _In_  DWORD dwFlags
	);
*/

AW_BLEND		:= 0x00080000	; Uses a fade effect.
AW_SLIDE		:= 0x00040000	; Uses slide animation. By default, roll animation is used.
AW_CENTER		:= 0x00000010	; Animate collapse/expand to/from middle.
AW_HIDE			:= 0x00010000	; Hides the window. By default, the window is shown.
AW_ACTIVATE		:= 0x00020000	; Activates the window. Do not use this value with AW_HIDE.
AW_HOR_POSITIVE	:= 0x00000001	; Animates the window from left to right.
AW_HOR_NEGATIVE	:= 0x00000002	; Animates the window from right to left.
AW_VER_POSITIVE	:= 0x00000004	; Animates the window from top to bottom.
AW_VER_NEGATIVE	:= 0x00000008	; Animates the window from bottom to top.

AnimateWindow(h,t,f) {
	return DllCall("AnimateWindow","UInt",h,"UInt",t,"UInt",f)
}

#NoEnv
#SingleInstance, Ignore
SetBatchLines -1
SetWinDelay 0

Gui, +HwndhGUI +ToolWindow
Gui, Color, c1A1A1A
Gui, Font, s18 cFEFEFE
Gui, Add, Text, x0 y224 w640 Center, AnimateWindow Test
Gui, Font, s8 cFEFEFE
Gui, Add, Text, x0 y+4 wp Center, Press Space to animate this window.
Gui, Show, w640 h480
GroupAdd,hGroup,ahk_id %hGUI%
return

GuiClose:
ExitApp

#IfWinActive ahk_group hGroup
Space::
	AW_TIME:=500
	
	MsgBox AnimateWindow : Fade In/Out
		AnimateWindow(hGUI, AW_TIME, AW_BLEND|AW_HIDE) ;Hide
		AnimateWindow(hGUI, AW_TIME, AW_BLEND) ;Show

	MsgBox AnimateWindow : Roll Horizontal
		AnimateWindow(hGUI, AW_TIME, AW_HOR_POSITIVE|AW_HIDE) ;Hide
		AnimateWindow(hGUI, AW_TIME, AW_HOR_NEGATIVE) ;Show

	MsgBox AnimateWindow : Roll Vertical
		AnimateWindow(hGUI, AW_TIME, AW_VER_POSITIVE|AW_HIDE) ;Hide
		AnimateWindow(hGUI, AW_TIME, AW_VER_NEGATIVE) ;Show

	MsgBox AnimateWindow : Slide Horizontal
		AnimateWindow(hGUI, AW_TIME, AW_HOR_POSITIVE|AW_SLIDE|AW_HIDE) ;Hide
		AnimateWindow(hGUI, AW_TIME, AW_HOR_NEGATIVE|AW_SLIDE) ;Show

	MsgBox AnimateWindow : Slide Vertical
		AnimateWindow(hGUI, AW_TIME, AW_VER_POSITIVE|AW_SLIDE|AW_HIDE) ;Hide
		AnimateWindow(hGUI, AW_TIME, AW_VER_NEGATIVE|AW_SLIDE) ;Show

	MsgBox AnimateWindow : Roll Collapse/Expand to/from middle
		AnimateWindow(hGUI, AW_TIME, AW_CENTER|AW_HIDE) ;Hide
		AnimateWindow(hGUI, AW_TIME, AW_CENTER) ;Show
		
	MsgBox AnimateWindow :  Done!
return
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: WinApi, DllCalls & AHK

10 Apr 2014, 05:20

update:
Add File Management Functions \ GetFileAttributes
Add File Management Functions \ GetFileSize
Add File Management Functions \ GetFileSizeEx
Add File Management Functions \ GetTempPath
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: WinApi, DllCalls & AHK

15 May 2014, 08:45

update:
Add Error Handling Functions \ FormatMessage
Add Error Handling Functions \ GetLastError
Add PSAPI Functions \ GetModuleFileNameEx
Fix c++ codes
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
djvj11
Posts: 15
Joined: 21 Jun 2014, 01:30

Re: WinApi, DllCalls & AHK

10 Jul 2014, 22:56

Great job so far, thanks!

Could you look at adding support for Raw Input. like getting the device list, registering your app, and receiving input data from the devices on that list?

http://msdn.microsoft.com/en-us/library ... s.85).aspx
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: WinApi, DllCalls & AHK

11 Mar 2015, 04:20

update:
Change License
Fix Bugs
Add Error handling
Add Directory Management Functions \ CreateDirectory
Add Directory Management Functions \ RemoveDirectory
Add Directory Management Functions \ SetCurrentDirectory
Add Mouse Input Functions \ ClipCursor
Add System Information Functions \ GetUserNameEx

Please report any bugs or mistakes.
New update with bugfixes, error handlings and new Functions coming soon
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile

Return to “Tutorials (v1)”

Who is online

Users browsing this forum: No registered users and 39 guests