Structor retrieves the 32 and 64-bit offsets of structures and generates AHK code. It was inspired on Lexicos' StructParser.
The
The Copy button generates the AHK code and copy it to the clipboard.
Given the input:
Code: Select all
typedef struct {
int iBitmap;
int idCommand;
BYTE fsState;
BYTE fsStyle;
#ifdef _WIN64
BYTE bReserved[6];
#else
#if defined(_WIN32)
BYTE bReserved[2];
#endif
#endif
DWORD_PTR dwData;
INT_PTR iString;
} TBBUTTON, *PTBBUTTON, *LPTBBUTTON;
Code: Select all
VarSetCapacity(TBBUTTON, A_PtrSize == 8 ? 32 : 20, 0)
NumPut(iBitmap, TBBUTTON, 0, "Int")
NumPut(idCommand, TBBUTTON, 4, "Int")
NumPut(fsState, TBBUTTON, 8, "UChar")
NumPut(fsStyle, TBBUTTON, 9, "UChar")
NumPut(bReserved, TBBUTTON, 10, "UChar")
;NumPut(bReserved, TBBUTTON, 10, "UChar")
NumPut(dwData, TBBUTTON, A_PtrSize == 8 ? 16 : 12, "UPtr")
NumPut(iString, TBBUTTON, A_PtrSize == 8 ? 24 : 16, "Ptr")
Code: Select all
typedef struct _SHFILEINFO {
HICON hIcon;
int iIcon;
DWORD dwAttributes;
TCHAR szDisplayName[MAX_PATH];
TCHAR szTypeName[80];
} SHFILEINFO;
Code: Select all
x64 := A_PtrSize == 8
VarSetCapacity(SHFILEINFO, x64 ? 696 : 692, 0)
hIcon := NumGet(SHFILEINFO, 0, "Ptr")
iIcon := NumGet(SHFILEINFO, x64 ? 8 : 4, "Int")
dwAttributes := NumGet(SHFILEINFO, x64 ? 12 : 8, "UInt")
szDisplayName := StrGet(&SHFILEINFO + (x64 ? 16 : 12), 260, "UTF-16")
szTypeName := StrGet(&SHFILEINFO + (x64 ? 536 : 532), 80, "UTF-16")
♦ Microsoft C/C++ compiler (Visual Studio, Windows SDK) or GCC (MinGW, TDM-GCC)
Download (AutoGUI tools)
EDIT: postimg.org changed domain to postimg.cc.