Verifier - Size of Data Types and Constant Values

Old Topics related to the original "AutoGUI" ahk script editor.
User avatar
Alguimist
Posts: 428
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: 3183
Joined: 30 Sep 2013, 01:33
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

; some code

; create sizeof.cpp
code := ((A_IsUnicode) ? "#define UNICODE 1`n" : "")    ; <--
     . "#include ..."
; some code[
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
Alguimist
Posts: 428
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: 3183
Joined: 30 Sep 2013, 01:33
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] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
Drugwash
Posts: 850
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

; GLOBAL SETTINGS ===============================================================================================================

#NoEnv
#SingleInstance Force
SetBatchLines -1

; GUI ===========================================================================================================================

Gui, +LastFound
Gui, Margin, 10, 10
Gui, Color, AA88FF
Gui, Add, Radio, w100 vRB1, Radio1
Gui, Add, Radio, xm y+10 w100 vRB2, Radio2
Gui, Add, CheckBox, w100 vCB, CheckBox
Gui, Add, Edit, xm w100 h30
Gui, Add, Button, xm y+2 w100 vPB, Button
Gui, Show, w200 h200
WinSet, Redraw
return

; FUNCTIONS =====================================================================================================================

CtlColorBtns()
{
    static init := OnMessage(0x0135, "CtlColorBtns")
    return DllCall("GetStockObject", "uint", 5, "uptr")
}

; EXIT ==========================================================================================================================

GuiClose:
GuiEscape:
ExitApp
Part of my AHK work can be found here.
User avatar
Alguimist
Posts: 428
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 “Old Topics”

Who is online

Users browsing this forum: No registered users and 4 guests