| View previous topic :: View next topic |
| Author |
Message |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4652 Location: AHK Forum
|
Posted: Mon Mar 08, 2010 2:50 pm Post subject: [AHK_H] - WinDlls() |
|
|
WinDlls() wraps a lot of Windows dlls and allows to use DllCall much easier.
Additionally it saves a lot of code
Requires AutoHotkey_H.exe or dll due to DynaCall!
| WinDlls(mapping,object) wrote: |
mapping:
WinDlls supports 4 modes:
1. Enable all functions | Code: | _:=WinDlls("") ;example how to load all available dlls and their functions not using any mapping
MsgBox % _.GetProcAddress(_.LoadLibrary.("AutoHotkey.dll"),"ahkReady")
|
2. Enable only certain dll(s) | Code: | _:=WinDlls("kernel32.dll") ;example how to load only required dll(s) not using any mapping
MsgBox % _.GetProcAddress(_.LoadLibrary.("AutoHotkey.dll"),"ahkReady")
|
3. Enable only certain functions | Code: | _:=WinDlls("LoadLibrary GetProcAddress") ;example how to load only required functions not using any mapping
MsgBox % _.GetProcAddress(_.LoadLibrary.("AutoHotkey.dll"),"ahkReady")
|
4. Enable only certain functions and use abbreviation mapping. | Code: | _:=WinDlls("LoadLibrary=ll GetProcAddress=gpa") ;add/load only some functions and use abbreviation mapping
MsgBox % _.gpa(_.ll("AutoHotkey.dll"),"ahkdll") |
You can also have a mix of 2/3/4
object:
You can pass an object to WinDlls so the functions will be added to your existing object. | Code: | A:=Object() ;here an existing object will be passed to WinDlls and functions will be added.
WinDlls("AnimateWindow=WinAni sleep",A) ;enable only 2 function and rename AnimateWindow to WinAni
Gui,+LastFound
hwnd:=WinExist()
Gui,Show,Hide w400 h600
A.WinAni(hwnd,1000,0x20000|0x10) ;show Window
A.sleep(1000) ;sleep 1000 ms
A.WinAni(hwnd,1000,0x10000|0x10) ;hide Window
ExitApp |
|
Of course I have not tested all functions, so please report any bugs.
Enjoy  _________________ AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun 
Last edited by HotKeyIt on Sat Dec 24, 2011 1:09 pm; edited 14 times in total |
|
| Back to top |
|
 |
wiseley
Joined: 22 Apr 2009 Posts: 29
|
Posted: Tue Mar 09, 2010 11:56 pm Post subject: |
|
|
wow, this is great
Thanks HotKeyIt |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Tue May 04, 2010 12:53 pm Post subject: |
|
|
Looks great, thx.
I just wish DynaCall or some form of it is included in AHK_L. _________________
 |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4652 Location: AHK Forum
|
|
| Back to top |
|
 |
Carcophan
Joined: 24 Dec 2008 Posts: 1308 Location: :noitacoL
|
Posted: Wed Jun 02, 2010 12:23 am Post subject: |
|
|
| 306 GDI32 calls. The gaming sector has some work to do! |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4652 Location: AHK Forum
|
Posted: Thu Dec 22, 2011 2:30 pm Post subject: |
|
|
Update
- Recreated all functions and corrected all parameters and return types. (6160 functions in 28 dlls)
- All functions available as Unicode and Ansi (...W ...A) are now also available without W/A suffix.
- - For example CreateFileA and CreateFileW are also available as CreateFile
- - - CreateFile will be CreateFileA in ANSI builds and CreateFileW in UNICODE builds.
Enjoy
EDIT:
Added missing functions
EDIT:
Removed duplicates and fixed some incorrect parameters _________________ AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun  |
|
| Back to top |
|
 |
|