From 0f6698f3b9f95552b2ad4a9dcd271941303067cd Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Tue, 14 Apr 2020 17:12:52 +0200 Subject: use Win95 fonts and colors even when running on Win32s/NT3.51 --- alf/alflabel.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'alf/alflabel.cpp') diff --git a/alf/alflabel.cpp b/alf/alflabel.cpp index 422a8dc..73216e1 100644 --- a/alf/alflabel.cpp +++ b/alf/alflabel.cpp @@ -131,7 +131,12 @@ ALF__LabelWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) TCHAR *text = ALF_Text(hwnd); if (!IsWindowEnabled(hwnd)) { - if (GetVersion() >= 0x80000000) { + if (!ALF_Compat_IsMinWindowsVersion(4, 0)) { + // Win32s/NT 3.51 uses gray text, but a different gray than Win9x + SetTextColor(hdc, GetSysColor(COLOR_BTNSHADOW)); + + DrawText(hdc, text, -1, &rc, format); + } if (GetVersion() >= 0x80000000) { // Win9x just uses gray text. DSS_DISABLED is broken there, too, // so we can't get the NT look even if we wanted to SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT)); @@ -209,7 +214,7 @@ ALF_AddLabel(HWND win, WORD id, UINT x, UINT y, const TCHAR *text) { HWND hwndLabel = CreateWindow(_alf_labelClass, text, - WS_CHILD | WS_VISIBLE | SS_OWNERDRAW, + WS_CHILD | WS_VISIBLE, 0, 0, 100, 100, win, (HMENU)(int)id, @@ -246,12 +251,6 @@ ALF_RegisterLabelClass(void) cls.hInstance = ALF_HINSTANCE; cls.hCursor = LoadCursor(NULL, (LPTSTR)IDC_ARROW); - if (LOBYTE(LOWORD(GetVersion())) >= 4) { - cls.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); - } else { - // NT 3.x has white dialog backgrounds - cls.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); - } cls.lpszClassName = classNameBuf; cls.cbWndExtra = sizeof(void*); cls.lpfnWndProc = ALF__LabelWindowProc; -- cgit v1.2.3