From f938064c8dc74d1eae4697454eeb640afc5e1d06 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Wed, 30 Apr 2008 10:55:35 +0000 Subject: [PATCH] - use tab control as parent for the child dialogs - fixes display problems - thanks to GedMurphy & Colin_Finck for finding the issue svn path=/trunk/; revision=33196 --- reactos/base/applications/dxdiag/display.c | 2 +- reactos/base/applications/dxdiag/dxdiag.c | 16 ++++++++++------ reactos/base/applications/dxdiag/precomp.h | 1 + reactos/base/applications/dxdiag/sound.c | 4 ++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/reactos/base/applications/dxdiag/display.c b/reactos/base/applications/dxdiag/display.c index 946d46ce8eb..68249512a1a 100644 --- a/reactos/base/applications/dxdiag/display.c +++ b/reactos/base/applications/dxdiag/display.c @@ -313,7 +313,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->hTabCtrl, DisplayPageWndProc, (LPARAM)pContext); if (!hwndDlg) break; diff --git a/reactos/base/applications/dxdiag/dxdiag.c b/reactos/base/applications/dxdiag/dxdiag.c index 4f6c3428d23..40ca45e1b15 100644 --- a/reactos/base/applications/dxdiag/dxdiag.c +++ b/reactos/base/applications/dxdiag/dxdiag.c @@ -98,15 +98,19 @@ TabCtrl_OnSelChange(PDXDIAG_CONTEXT pContext) VOID InitializeTabCtrl(HWND hwndDlg, PDXDIAG_CONTEXT pContext) { + /* get tabctrl */ + hTabCtrlWnd = GetDlgItem(hwndDlg, IDC_TAB_CONTROL); + pContext->hTabCtrl = hTabCtrlWnd; + /* create the dialogs */ - pContext->hDialogs[0] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SYSTEM_DIALOG), hwndDlg, SystemPageWndProc, (LPARAM)pContext); - pContext->hDialogs[1] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_MUSIC_DIALOG), hwndDlg, MusicPageWndProc, (LPARAM)pContext); - pContext->hDialogs[2] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_INPUT_DIALOG), hwndDlg, InputPageWndProc, (LPARAM)pContext); - pContext->hDialogs[3] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_NETWORK_DIALOG), hwndDlg, NetworkPageWndProc, (LPARAM)pContext); - pContext->hDialogs[4] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_HELP_DIALOG), hwndDlg, HelpPageWndProc, (LPARAM)pContext); + pContext->hDialogs[0] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SYSTEM_DIALOG), hTabCtrlWnd, SystemPageWndProc, (LPARAM)pContext); + pContext->hDialogs[1] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_MUSIC_DIALOG), hTabCtrlWnd, MusicPageWndProc, (LPARAM)pContext); + pContext->hDialogs[2] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_INPUT_DIALOG), hTabCtrlWnd, InputPageWndProc, (LPARAM)pContext); + pContext->hDialogs[3] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_NETWORK_DIALOG), hTabCtrlWnd, NetworkPageWndProc, (LPARAM)pContext); + pContext->hDialogs[4] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_HELP_DIALOG), hTabCtrlWnd, HelpPageWndProc, (LPARAM)pContext); /* insert tab ctrl items */ - hTabCtrlWnd = GetDlgItem(hwndDlg, IDC_TAB_CONTROL); + InsertTabCtrlItem(hTabCtrlWnd, 0, MAKEINTRESOURCEW(IDS_SYSTEM_DIALOG)); InitializeDisplayAdapters(pContext); InitializeDirectSoundPage(pContext); diff --git a/reactos/base/applications/dxdiag/precomp.h b/reactos/base/applications/dxdiag/precomp.h index 4e55a02dd85..a418c3d3750 100644 --- a/reactos/base/applications/dxdiag/precomp.h +++ b/reactos/base/applications/dxdiag/precomp.h @@ -20,6 +20,7 @@ typedef struct { HWND hMainDialog; + HWND hTabCtrl; ULONG NumDisplayAdapter; HWND * hDisplayWnd; ULONG NumSoundAdapter; diff --git a/reactos/base/applications/dxdiag/sound.c b/reactos/base/applications/dxdiag/sound.c index 00d69913b73..16199bb10f2 100644 --- a/reactos/base/applications/dxdiag/sound.c +++ b/reactos/base/applications/dxdiag/sound.c @@ -29,7 +29,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->hTabCtrl, SoundPageWndProc, (LPARAM)pContext); if (!hwndDlg) return FALSE; @@ -40,7 +40,7 @@ BOOL CALLBACK DSEnumCallback(LPGUID lpGuid, LPCWSTR lpcstrDescription, LPCWSTR l swprintf (szText, L"%s %u", szSound, pContext->NumSoundAdapter + 1); - InsertTabCtrlItem(GetDlgItem(pContext->hMainDialog, IDC_TAB_CONTROL), pContext->NumDisplayAdapter + pContext->NumSoundAdapter + 1, szText); + InsertTabCtrlItem(pContext->hTabCtrl, pContext->NumDisplayAdapter + pContext->NumSoundAdapter + 1, szText); hDlgs[pContext->NumSoundAdapter] = hwndDlg; pContext->NumSoundAdapter++;