Link: https://docs.microsoft.com/en-us/windows/win32/api/commdlg/ns-commdlg-choosefontw
Code: Select all
; size offset [32|64]
; typedef struct tagCHOOSEFONTW {
; DWORD lStructSize; |4 / 0
; HWND hwndOwner; |[4|8] / [ 4| 8] A_PtrSize * 1
; HDC hDC; |[4|8] / [ 8|16] A_PtrSize * 2
; LPLOGFONTW lpLogFont; |[4|8] / [12|24] A_PtrSize * 3
; INT iPointSize; |4 / [16|32] A_PtrSize * 4
; DWORD Flags; |4 / [20|36]
; COLORREF rgbColors; |4 / [24|40] --- this lines up with code
; LPARAM lCustData; |[4|8] / [28|48]
; LPCFHOOKPROC lpfnHook; |[4|8] / [32|56]
; LPCWSTR lpTemplateName; |[4|8] / [36|64]
; HINSTANCE hInstance; |[4|8] / [40|72]
; LPWSTR lpszStyle; |[4|8] / [44|80]
; WORD nFontType; |2 / [48|88]
; WORD ___MISSING_ALIGNMENT__; |2 / [50|90]
; INT nSizeMin; |4 / [52|92]
; INT nSizeMax; |4 / [56|96] -- len: 60 or 64? / 100 or 104?
; } CHOOSEFONTW;
I think my confusion is with the WORD alignment. I think a word is a 2-byte value, but not sure when/if/how I'm supposed to pad that for proper alignment.