mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
Fix dxdiag with the help of hbelusca and the nice trick he uses to get the dialog colorization done right.
svn path=/trunk/; revision=60219
This commit is contained in:
parent
1aee29c135
commit
22872994fc
4 changed files with 65 additions and 7 deletions
|
@ -339,7 +339,7 @@ void InitializeDisplayAdapters(PDXDIAG_CONTEXT pContext)
|
|||
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;
|
||||
|
||||
|
|
|
@ -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 @@ InitializeTabCtrl(HWND hwndDlg, PDXDIAG_CONTEXT pContext)
|
|||
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));
|
||||
|
|
|
@ -42,6 +42,9 @@ typedef struct
|
|||
/* 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);
|
||||
|
|
|
@ -208,7 +208,7 @@ BOOL CALLBACK DSEnumCallback(LPGUID lpGuid, LPCWSTR lpcstrDescription, LPCWSTR l
|
|||
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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue