#pragma once #include #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 { 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); } } long ALF_GetAveCharWidth(HDC hdc); void ALF_UniqueCounterValue(LONG_PTR *pCounterId, LONG_PTR *pCounterValue); extern BOOL (WINAPI *ALF_Compat_IsAppThemed)(void); extern UINT (WINAPI *ALF_Compat_GetDpiForWindow)(HWND); extern BOOL (WINAPI *ALF_Compat_AdjustWindowRectExForDpi)(LPRECT,DWORD,BOOL,DWORD,UINT); extern int (WINAPI *ALF_Compat_GetSystemMetricsForDpi)(int, UINT); extern BOOL (WINAPI *ALF_Compat_SetWindowSubclass)(HWND, ALF_COMPAT_SUBCLASSPROC, UINT_PTR, DWORD_PTR); extern LRESULT (WINAPI *ALF_Compat_DefSubclassProc)(HWND, UINT, WPARAM, LPARAM); extern BOOL (WINAPI *ALF_Compat_RemoveWindowSubclass)(HWND, ALF_COMPAT_SUBCLASSPROC, UINT_PTR); extern BOOL (WINAPI *ALF_Compat_SystemParametersInfoForDpi)(UINT,UINT,PVOID,UINT,UINT);