diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-04-14 17:48:45 +0200 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-04-14 17:48:45 +0200 |
| commit | 02ffd45d5cb15b7d025b9a72a21ec1fd32de8c6f (patch) | |
| tree | 70f04cfd220ecee9b261b3ac2bfe2cdf3da0d066 /alf/alfbutton.cpp | |
| parent | f8ac8f0e75c28047e93c8de627603a6c5a6aa833 (diff) | |
replace GetVersion() calls with helper functions
Diffstat (limited to 'alf/alfbutton.cpp')
| -rw-r--r-- | alf/alfbutton.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/alf/alfbutton.cpp b/alf/alfbutton.cpp index ce87f15..0bb0627 100644 --- a/alf/alfbutton.cpp +++ b/alf/alfbutton.cpp @@ -92,7 +92,6 @@ static void ALF__Button_Render95(HWND hwnd, ALFButtonPriv *priv, LPDRAWITEMSTRUCT dis) { RECT r = dis->rcItem; - DWORD v = GetVersion(); int textlen = GetWindowTextLength(hwnd); TCHAR *textbuf = ALF_New(TCHAR, textlen + 1); @@ -142,7 +141,7 @@ ALF__Button_Render95(HWND hwnd, ALFButtonPriv *priv, LPDRAWITEMSTRUCT dis) style |= DT_HIDEPREFIX; if (dis->itemState & ODS_DISABLED) { - if (v >= 0x80000000) { + if (ALF_Compat_IsWin9x()) { // Win9x just uses gray text. DSS_DISABLED is broken there, too, // so we can't get the NT look even if we wanted to COLORREF oldTextColor = SetTextColor(dis->hDC, GetSysColor(COLOR_GRAYTEXT)); @@ -322,7 +321,6 @@ ALF__ButtonSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT ReleaseDC(hwnd, hdc); } else if (uMsg == 0x2000 + WM_DRAWITEM) { LPDRAWITEMSTRUCT dis = (DRAWITEMSTRUCT *)lParam; - DWORD v = GetVersion(); if (!ALF_Compat_BufferedPaintRenderAnimation(hwnd, dis->hDC)) { if (priv->hTheme) { @@ -420,12 +418,12 @@ ALF__ButtonSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT } else { ALF__Button_RenderUxtheme(hwnd, priv, stateid, dis->itemState, dis->hDC, &dis->rcItem); } - } else if (LOBYTE(LOWORD(v)) < 4) { - // Draw pre-95 style button - ALF__Button_Render3x(hwnd, priv, dis); - } else { + } else if (ALF_Compat_IsMinWindowsVersion(4, 0)) { // Draw 95 style button ALF__Button_Render95(hwnd, priv, dis); + } else { + // Draw pre-95 style button + ALF__Button_Render3x(hwnd, priv, dis); } } |
