diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-04-14 17:12:52 +0200 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-04-14 17:12:52 +0200 |
| commit | 0f6698f3b9f95552b2ad4a9dcd271941303067cd (patch) | |
| tree | b5f68af0ecb6c1fe7d26cf6ea0992f9324f01b76 /alf/alflabel.cpp | |
| parent | 0948993ec9e08e170d1d22f2c7176b00bd987103 (diff) | |
use Win95 fonts and colors even when running on Win32s/NT3.51
Diffstat (limited to 'alf/alflabel.cpp')
| -rw-r--r-- | alf/alflabel.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
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; |
