Size Checker - Check the Size of Structures and Data Types

Discuss the AutoGUI IDE with a GUI designer and a script editor.
User avatar
Alguimist
Posts: 137
Joined: 05 Oct 2015, 16:41

Size Checker - Check the Size of Structures and Data Types

03 May 2017, 15:29

Image

Size of: structure or data type declared in a header file.
Examples: MSG, WORD, RECT, LVITEM (requires commctrl.h).

Set compiler and platform before defining the compiler path.

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. Example:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\vcvars32.bat

MinGW
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.

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

:arrow: Download (AutoGUI tools)
Last edited by Alguimist on 13 May 2017, 04:15, edited 1 time in total.
User avatar
jNizM
Posts: 2290
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.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
User avatar
Alguimist
Posts: 137
Joined: 05 Oct 2015, 16:41

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: 2290
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.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
User avatar
Drugwash
Posts: 263
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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


Return to “AutoGUI”

Who is online

Users browsing this forum: No registered users and 1 guest