Verifier - Size of Data Types and Constant Values

Script editor, GUI designer, debugger and tools for AutoHotkey
User avatar
Alguimist
Posts: 290
Joined: 05 Oct 2015, 16:41
Contact:

Verifier - Size of Data Types and Constant Values

03 May 2017, 15:29

Image

Usage: enter the name of a data type or constant declared in a header file.
Examples: DWORD, TBYTE, LVM_GETHEADER (requires commctrl.h), etc.

Set compiler and platform before defining the compiler path.

Windows SDK or Visual Studio
Compiler path: path to CL.EXE. Example:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe

Batch file: path to VCVARS32.BAT or VCVARS64.BAT or VCVARSX86_AMD64.BAT. Example:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\vcvars32.bat

MinGW, TDM-GCC
Compiler path: path to GCC.EXE. Example:
C:\Dev-Cpp\bin\gcc.exe

Batch file: only required if the gcc.exe directory is not in the PATH.

Another tool, Structor, is more appropriate for information about structures (size and offsets).

Credits
Thanks to the authors of AHK-SizeOf-Checker and StdoutToVar.

:arrow: Download (AutoGUI tools)
Last edited by Alguimist on 06 Apr 2018, 06:35, edited 2 times in total.
User avatar
jNizM
Posts: 2320
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: Size Checker - Check the Size of Structures and Data Types

04 May 2017, 01:05

Looks great =)
Since I used a sizeof checker too, I added 1 more line because I got some probs with calc size on unicode

Code: [Select all] [Download] GeSHi © Codebox Plus

; some code

; create sizeof.cpp
code := ((A_IsUnicode) ? "#define UNICODE 1`n" : "") ; <--
. "#include ..."
; some code[
[AHK] 1.1.29.01 x64 Unicode | [WIN] 10 Pro (Version 1803) x64 | [GitHub] Profile
Donations are appreciated if I could help you
User avatar
Alguimist
Posts: 290
Joined: 05 Oct 2015, 16:41
Contact:

Re: Size Checker - Check the Size of Structures and Data Types

04 May 2017, 04:48

Thanks, jNizM ;)

Update (version 1.1.0): this tool can also be used to check the offset of structure members and value of constants.
Examples: MSG.time, OPENFILENAME.Flags, WM_USER, TB_AUTOSIZE.
User avatar
jNizM
Posts: 2320
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: Size Checker - Check the Size of Structures and Data Types

04 May 2017, 05:42

2 more tips:

EM_SETCUEBANNER
Use EM_SETCUEBANNER with wParam 1 not 0
DllCall("SendMessage", "Ptr", handle, "UInt", 0x1501, "Ptr", 1, "WStr", Text) last Ptr can be removed since the return is bool
TRUE if the cue banner should show even when the edit control has focus; otherwise, FALSE. FALSE is the default behavior—the cue banner disappears when the user clicks in the control.


Buttons on white Gui's
To remove the grey border around the buttons border you can use this CtlColorBtns (thx to just me)
[AHK] 1.1.29.01 x64 Unicode | [WIN] 10 Pro (Version 1803) x64 | [GitHub] Profile
Donations are appreciated if I could help you
User avatar
Drugwash
Posts: 567
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania

Re: Size Checker - Check the Size of Structures and Data Types

27 May 2017, 04:37

jNizM wrote:Buttons on white Gui's
To remove the grey border around the buttons border you can use this CtlColorBtns (thx to just me)

That script leaks handles. According to the remarks for CreateSolidBrush():
MSDN wrote:When you no longer need the HBRUSH object, call the DeleteObject function to delete it.

Moreover, color should be manually changed for different window background colors - cumbersome. What about backgrounds made of pattern brush or image?

However, using GetStockObject() with NULL_BRUSH as parameter would avoid handle leaks and suit any window color/pattern/image:
MSDN wrote:It is not necessary (but it is not harmful) to delete stock objects by calling DeleteObject.


Code: [Select all] [Expand] [Download] (GUI_CtlColorBtns(mod).ahk)GeSHi © Codebox Plus

I've deleted my CloudMe account because of GDPR - the now legal base for privacy invasion and data theft.
User avatar
Alguimist
Posts: 290
Joined: 05 Oct 2015, 16:41
Contact:

Re: Verifier - Size of Data Types and Constant Values

06 Apr 2018, 06:36

Note: Size Checker was renamed to Verifier.

Return to “AutoGUI”

Who is online

Users browsing this forum: No registered users and 1 guest