Author: dreimer
Date: Thu Sep 19 22:05:19 2013
New Revision: 60219
URL:
http://svn.reactos.org/svn/reactos?rev=60219&view=rev
Log:
Fix dxdiag with the help of hbelusca and the nice trick he uses to get the dialog
colorization done right.
Modified:
trunk/reactos/base/applications/dxdiag/display.c
trunk/reactos/base/applications/dxdiag/dxdiag.c
trunk/reactos/base/applications/dxdiag/precomp.h
trunk/reactos/base/applications/dxdiag/sound.c
Modified: trunk/reactos/base/applications/dxdiag/display.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/d…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/display.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/display.c [iso-8859-1] Thu Sep 19 22:05:19
2013
@@ -339,7 +339,7 @@
break;
pContext->hDisplayWnd = hDlgs;
- hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_DISPLAY_DIALOG),
pContext->hMainDialog, DisplayPageWndProc, (LPARAM)pContext);
+ hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_DISPLAY_DIALOG),
pContext->hMainDialog, DisplayPageWndProc, (LPARAM)pContext);
EnableDialogTheme(hwndDlg);
if (!hwndDlg)
break;
Modified: trunk/reactos/base/applications/dxdiag/dxdiag.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/d…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/dxdiag.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/dxdiag.c [iso-8859-1] Thu Sep 19 22:05:19 2013
@@ -13,6 +13,61 @@
HINSTANCE hInst = 0;
HWND hTabCtrlWnd;
+////////////////////////////////////////////////////////////////////////////////
+// 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 = LoadLibraryA("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;
+ }
+}
+
//---------------------------------------------------------------
VOID
DestroyTabCtrlDialogs(PDXDIAG_CONTEXT pContext)
@@ -119,11 +174,11 @@
pContext->hTabCtrl = hTabCtrlWnd;
/* create the dialogs */
- pContext->hDialogs[0] = CreateDialogParamW(hInst,
MAKEINTRESOURCEW(IDD_SYSTEM_DIALOG), pContext->hMainDialog, SystemPageWndProc,
(LPARAM)pContext);
- pContext->hDialogs[1] = CreateDialogParamW(hInst,
MAKEINTRESOURCEW(IDD_MUSIC_DIALOG), pContext->hMainDialog, MusicPageWndProc,
(LPARAM)pContext);
- pContext->hDialogs[2] = CreateDialogParamW(hInst,
MAKEINTRESOURCEW(IDD_INPUT_DIALOG), pContext->hMainDialog, InputPageWndProc,
(LPARAM)pContext);
- pContext->hDialogs[3] = CreateDialogParamW(hInst,
MAKEINTRESOURCEW(IDD_NETWORK_DIALOG), pContext->hMainDialog, NetworkPageWndProc,
(LPARAM)pContext);
- pContext->hDialogs[4] = CreateDialogParamW(hInst,
MAKEINTRESOURCEW(IDD_HELP_DIALOG), pContext->hMainDialog, HelpPageWndProc,
(LPARAM)pContext);
+ pContext->hDialogs[0] = CreateDialogParamW(hInst,
MAKEINTRESOURCEW(IDD_SYSTEM_DIALOG), pContext->hMainDialog, SystemPageWndProc,
(LPARAM)pContext); EnableDialogTheme(pContext->hDialogs[0]);
+ pContext->hDialogs[1] = CreateDialogParamW(hInst,
MAKEINTRESOURCEW(IDD_MUSIC_DIALOG), pContext->hMainDialog, MusicPageWndProc,
(LPARAM)pContext); EnableDialogTheme(pContext->hDialogs[1]);
+ pContext->hDialogs[2] = CreateDialogParamW(hInst,
MAKEINTRESOURCEW(IDD_INPUT_DIALOG), pContext->hMainDialog, InputPageWndProc,
(LPARAM)pContext); EnableDialogTheme(pContext->hDialogs[2]);
+ pContext->hDialogs[3] = CreateDialogParamW(hInst,
MAKEINTRESOURCEW(IDD_NETWORK_DIALOG), pContext->hMainDialog, NetworkPageWndProc,
(LPARAM)pContext); EnableDialogTheme(pContext->hDialogs[3]);
+ pContext->hDialogs[4] = CreateDialogParamW(hInst,
MAKEINTRESOURCEW(IDD_HELP_DIALOG), pContext->hMainDialog, HelpPageWndProc,
(LPARAM)pContext); EnableDialogTheme(pContext->hDialogs[4]);
/* insert tab ctrl items */
InsertTabCtrlItem(hTabCtrlWnd, 0, MAKEINTRESOURCEW(IDS_SYSTEM_DIALOG));
Modified: trunk/reactos/base/applications/dxdiag/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/p…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/precomp.h [iso-8859-1] Thu Sep 19 22:05:19
2013
@@ -42,6 +42,9 @@
/* globals */
extern HINSTANCE hInst;
+/* theming hack */
+BOOL EnableDialogTheme(HWND hwnd);
+
/* dialog wnd proc */
INT_PTR CALLBACK SystemPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM
lParam);
INT_PTR CALLBACK DisplayPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM
lParam);
Modified: trunk/reactos/base/applications/dxdiag/sound.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/s…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/sound.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/sound.c [iso-8859-1] Thu Sep 19 22:05:19 2013
@@ -208,7 +208,7 @@
return FALSE;
pContext->hSoundWnd = hDlgs;
- hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SOUND_DIALOG),
pContext->hMainDialog, SoundPageWndProc, (LPARAM)pContext);
+ hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SOUND_DIALOG),
pContext->hMainDialog, SoundPageWndProc, (LPARAM)pContext);
EnableDialogTheme(hwndDlg);
if (!hwndDlg)
return FALSE;