#include #ifndef WM_DPICHANGED #define WM_DPICHANGED 0x02E0 #endif typedef LRESULT (CALLBACK *ALF_COMPAT_SUBCLASSPROC)(HWND,UINT,WPARAM,LPARAM,UINT_PTR,DWORD_PTR); typedef struct { LRESULT (WINAPI *SetWindowSubclass)(HWND, ALF_COMPAT_SUBCLASSPROC, UINT_PTR, DWORD_PTR); LRESULT (WINAPI *DefSubclassProc)(HWND, UINT, WPARAM, LPARAM); BOOL (WINAPI *RemoveWindowSubclass)(HWND, ALF_COMPAT_SUBCLASSPROC, UINT_PTR); int (WINAPI *GetSystemMetricsForDpi)(int, UINT); BOOL (WINAPI *IsAppThemed)(void); UINT (WINAPI *GetDpiForWindow)(HWND); BOOL (WINAPI *SystemParametersInfoForDpi)(UINT,UINT,PVOID,UINT,UINT); BOOL (WINAPI *AdjustWindowRectExForDpi)(LPRECT,DWORD,BOOL,DWORD,UINT); } ALFCompatFunctions; typedef struct { UINT cbSize; int iBorderWidth; int iScrollWidth; int iScrollHeight; int iCaptionWidth; int iCaptionHeight; LOGFONT lfCaptionFont; int iSmCaptionWidth; int iSmCaptionHeight; LOGFONT lfSmCaptionFont; int iMenuWidth; int iMenuHeight; LOGFONT lfMenuFont; LOGFONT lfStatusFont; LOGFONT lfMessageFont; int iPaddedBorderWidth; // new in Vista } ALF_NONCLIENTMETRICS_VISTA; static inline SIZE_T ALF_SizeOf_NONCLIENTMETRICS(void) { if (LOBYTE(LOWORD(GetVersion())) >= 6) { return sizeof(ALF_NONCLIENTMETRICS_VISTA); } else { return sizeof(ALF_NONCLIENTMETRICS_VISTA) - sizeof(int); } } ALFCompatFunctions * ALF_CreateCompatFuncTable(void); long ALF_GetAveCharWidth(HDC hdc);