summaryrefslogtreecommitdiff
path: root/alf
diff options
context:
space:
mode:
Diffstat (limited to 'alf')
-rw-r--r--alf/alf.cpp6
-rw-r--r--alf/alfcompat.h29
2 files changed, 33 insertions, 2 deletions
diff --git a/alf/alf.cpp b/alf/alf.cpp
index 9d1379c..b711085 100644
--- a/alf/alf.cpp
+++ b/alf/alf.cpp
@@ -59,9 +59,11 @@ ALF_UpdateFontsPriv(HWND win, ALFWindowPriv *priv)
{
priv->fonts.dpi = priv->app->compatFn->GetDpiForWindow(win);
- NONCLIENTMETRICS ncm;
+ // XXX: SystemParametersInfoForDpi needs the Vista+ NONCLIENTMETRICS,
+ // but we want to be able to build with WINVER = 0x0500 and PSDK2003
+ ALF_NONCLIENTMETRICS_VISTA ncm;
ZeroMemory(&ncm, sizeof(ncm));
- ncm.cbSize = sizeof(ncm);
+ ncm.cbSize = ALF_SizeOf_NONCLIENTMETRICS();
if (priv->app->compatFn->SystemParametersInfoForDpi(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0, priv->fonts.dpi)) {
priv->fonts.lfMessageFont = ncm.lfMessageFont;
diff --git a/alf/alfcompat.h b/alf/alfcompat.h
index 846590c..ba315e1 100644
--- a/alf/alfcompat.h
+++ b/alf/alfcompat.h
@@ -17,6 +17,35 @@ typedef struct {
} 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);