Windows Data Types for AHK

Post your working scripts, libraries and tools
User avatar
jNizM
Posts: 2341
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Windows Data Types for AHK

05 May 2015, 06:34

Windows Data Types for AHK
Translated MSDN Types for DllCall's in AutoHotkey

Source
AutoHotkey_MSDN_Types (GitHub)

Features
- Offline Version: Pro (Faster than the online version) | Con (Must be updated manually)
- Online Version: Pro (Downloaded every time the latest translation) | Con (Slower than the offline version)

Screenshots
- After starting
Image
- After search something (like LP...)
Image

Info
- Version: v0.2
- URL AHK Thread

Changelog
- 0.2 | Small fixes
- 0.1 | First Release

Contributing
- special thanks to just me
- thanks to AutoHotkey Community

Copyright and License
Unlicense

References and useful links
- Header Annotations
- Windows Data Types
- Data Type Ranges
- Large Integers
- Windows Coding Conventions
- What Is a Window?
- Structure Alignment

Programming Guide for 64-bit Windows
- The New Data Types
- Rules for Using Pointers

Please report any kind of bugs (Script, Gui or Type translation)
[AHK] 1.1.30.01 x64 Unicode | [WIN] 10 Pro (Version 1803) x64 | [GitHub] Profile
Donations are appreciated if I could help you
tmplinshi
Posts: 1281
Joined: 01 Oct 2013, 14:57

Re: Windows Data Types for AHK

05 May 2015, 10:31

Thanks :D
User avatar
evilC
Posts: 4372
Joined: 27 Feb 2014, 12:30

Re: Windows Data Types for AHK

17 Jul 2015, 09:29

Extremely useful! Thankyou!

May I make a suggestion?
How about a checkbox or something to control matching behavior?

For example, if you type UINT, it shows PUINT etc.
A checkbox to state that the match much start with what you typed would enable you to find the correct datatype quicker, and may also speed up searches.

[Edit]
Also, could you maybe have it ignore trailing spaces?
If you double click a definition on MSDN and copy / paste, you end up with trailing spaces.

For example, on this page, if I double click the word UINT and CTRL+C, you get UINT plus 15 spaces afterwards.

[Yet another Edit]
Also, how about a hotkey, that when you hit it, it copies the selected text and puts it in the search box?
tmplinshi
Posts: 1281
Joined: 01 Oct 2013, 14:57

Re: Windows Data Types for AHK

25 Jul 2015, 01:27

@evilC
Your suggestion is exactly what I needed too. :)
I made these changes:

Code: Select all

Added:
    - "Contains" checkbox.
    - Double-click cell to copy text.
    - Auto select text in edit box when focused.
    - "Always On Top" checkbox.
Modified:
    - Trim keyword, etc...
Source: https://gist.github.com/tmplinshi/cedaf22f1de666539886
tmplinshi
Posts: 1281
Joined: 01 Oct 2013, 14:57

Re: Windows Data Types for AHK

25 Jul 2015, 05:26

Seems not.
User avatar
evilC
Posts: 4372
Joined: 27 Feb 2014, 12:30

Re: Windows Data Types for AHK

25 Jul 2015, 08:15

The version I tested was

https://dl.dropboxusercontent.com/u/406 ... _Types.ahk

He also added some hotkeys to copy what was selected and strip spaces - if you double-click a datatype column in an MSDN definition , you select the whole space-padded column.
I think he was also working on a hotkey such that if you hit it, it pasted the best (ie shortest match) answer straight into your text editor - so you don't even have to have the app visible to use it.
tmplinshi
Posts: 1281
Joined: 01 Oct 2013, 14:57

Re: Windows Data Types for AHK

25 Jul 2015, 11:30

Thanks. Good idea to use hotkey.
jballi
Posts: 521
Joined: 29 Sep 2013, 17:34

Re: Windows Data Types for AHK

25 Jul 2015, 17:59

I just found this. Late to the game as usual. Looks useful. Thanks.
User avatar
jNizM
Posts: 2341
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: Windows Data Types for AHK

25 May 2016, 01:37

Added References and useful links.
If you got more, let me know and I will add them.
[AHK] 1.1.30.01 x64 Unicode | [WIN] 10 Pro (Version 1803) x64 | [GitHub] Profile
Donations are appreciated if I could help you
swagfag
Posts: 1563
Joined: 11 Jan 2017, 17:59

Re: Windows Data Types for AHK

01 Dec 2018, 15:28

damn, how do i find out about this only just now. this should be linked to from the docs or something.
anyway, what are the alternatives for? whats the upshot of just using the AHK Type all the time, everywhere?
User avatar
jeeswg
Posts: 5433
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Windows Data Types for AHK

02 Dec 2018, 18:46

- Hello swagfag, I'm unsure what you're asking. I find this kind of info useful for translating the hundreds of types listed on MSDN for Winapi functions and structs, and converting them to the AHK type for use with DllCall and structs. You can also get size/sign info via Visual Studio.

- HotKeyIt keeps a very good list of parameter information, and here are 2 other links where I check and use that list. Cheers.

WinApi
https://hotkeyit.github.io/v2/docs/commands/WinApi.htm
C++: DllCall: get parameter types/sizes - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 23&t=39426
DllCall converter/cleaner (e.g. x32 to x64/x32 two-way compatible) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=31365
swagfag
Posts: 1563
Joined: 11 Jan 2017, 17:59

Re: Windows Data Types for AHK

02 Dec 2018, 18:49

Ex, LPSTR can be Ptr or alternatively Str, as per this list. So does it make any difference if one were to use the first type, Ptr, all the time everywhere?
User avatar
jeeswg
Posts: 5433
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Windows Data Types for AHK

02 Dec 2018, 19:00

- You can use Ptr,&var or Str,var, they're generally interchangeable.
- IIRC Str has the advantage of resolving the data to a string for you, otherwise you might need to use VarSetCapacity(var, -1).
- In some situations you need to be careful that a parameter can be both written to and read from, I can't remember if this affects Ptr/Str.
- Maybe there are times when the string could have multiple null characters in it, so you'd have to use Ptr.
- Also, using AStr or WStr can be more convenient than StrPut and Ptr.
Helgef
Posts: 3303
Joined: 17 Jul 2016, 01:02
Contact:

Re: Windows Data Types for AHK

05 Dec 2018, 04:56

Nice script :thumbup: .
So does it make any difference if one were to use the first type, Ptr, all the time everywhere?
Assuming the list is correct, you can always use the first and second type, as long as you pass an argument which matches the type. You can read about the types in dllcall -> Types of Arguments and Return Values.

Cheers.
iseahound
Posts: 355
Joined: 13 Aug 2016, 21:04
GitHub: iseahound

Re: Windows Data Types for AHK

06 Dec 2018, 11:12

Thanks! If possible, can this list be included in the help file for DllCall? It would make translation of Windows API calls much easier for everyone.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Xtra and 23 guests