Author: dreimer Date: Thu Jan 16 00:10:01 2014 New Revision: 61641
URL: http://svn.reactos.org/svn/reactos?rev=61641&view=rev Log: "Hack" to fix colors in themed mode in Windows AND ReactOS. Taken from WinSpy++ (http://www.catch22.net/software/winspy) by J Brown
Modified: trunk/reactos/base/applications/msconfig/msconfig.c
Modified: trunk/reactos/base/applications/msconfig/msconfig.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig/... ============================================================================== --- trunk/reactos/base/applications/msconfig/msconfig.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/msconfig.c [iso-8859-1] Thu Jan 16 00:10:01 2014 @@ -25,18 +25,72 @@
void MsConfig_OnTabWndSelChange(void);
+//////////////////////////////////////////////////////////////////////////////// +// Taken from WinSpy++ 1.7 +// http://www.catch22.net/software/winspy +// Copyright (c) 2002 by J Brown +// + +// +// Copied from uxtheme.h +// If you have this new header, then delete these and +// #include <uxtheme.h> instead! +// +#define ETDT_DISABLE 0x00000001 +#define ETDT_ENABLE 0x00000002 +#define ETDT_USETABTEXTURE 0x00000004 +#define ETDT_ENABLETAB (ETDT_ENABLE | ETDT_USETABTEXTURE) + +// +typedef HRESULT (WINAPI * ETDTProc) (HWND, DWORD); + +// +// Try to call EnableThemeDialogTexture, if uxtheme.dll is present +// +BOOL EnableDialogTheme(HWND hwnd) +{ + HMODULE hUXTheme; + ETDTProc fnEnableThemeDialogTexture; + + hUXTheme = LoadLibrary(_T("uxtheme.dll")); + + if(hUXTheme) + { + fnEnableThemeDialogTexture = + (ETDTProc)GetProcAddress(hUXTheme, "EnableThemeDialogTexture"); + + if(fnEnableThemeDialogTexture) + { + fnEnableThemeDialogTexture(hwnd, ETDT_ENABLETAB); + + FreeLibrary(hUXTheme); + return TRUE; + } + else + { + // Failed to locate API! + FreeLibrary(hUXTheme); + return FALSE; + } + } + else + { + // Not running under XP? Just fail gracefully + return FALSE; + } +} BOOL OnCreate(HWND hWnd) { TCHAR szTemp[256]; TCITEM item;
hTabWnd = GetDlgItem(hWnd, IDC_TAB); - hGeneralPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_GENERAL_PAGE), hWnd, GeneralPageWndProc); - hSystemPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SYSTEM_PAGE), hWnd, SystemPageWndProc); - hFreeLdrPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_FREELDR_PAGE), hWnd, FreeLdrPageWndProc); - hServicesPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SERVICES_PAGE), hWnd, ServicesPageWndProc); - hStartupPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_STARTUP_PAGE), hWnd, StartupPageWndProc); - hToolsPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_TOOLS_PAGE), hWnd, ToolsPageWndProc); + hGeneralPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_GENERAL_PAGE), hWnd, GeneralPageWndProc); EnableDialogTheme(hGeneralPage); + hSystemPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SYSTEM_PAGE), hWnd, SystemPageWndProc); EnableDialogTheme(hSystemPage); + hFreeLdrPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_FREELDR_PAGE), hWnd, FreeLdrPageWndProc); EnableDialogTheme(hFreeLdrPage); + hServicesPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SERVICES_PAGE), hWnd, ServicesPageWndProc); EnableDialogTheme(hServicesPage); + hStartupPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_STARTUP_PAGE), hWnd, StartupPageWndProc); EnableDialogTheme(hStartupPage); + hToolsPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_TOOLS_PAGE), hWnd, ToolsPageWndProc); EnableDialogTheme(hToolsPage);
LoadString(hInst, IDS_MSCONFIG, szTemp, 256); SetWindowText(hWnd, szTemp);