- use tab control as parent for the child dialogs
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 30 Apr 2008 10:55:35 +0000 (10:55 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 30 Apr 2008 10:55:35 +0000 (10:55 +0000)
- fixes display problems
- thanks to GedMurphy & Colin_Finck for finding the issue

svn path=/trunk/; revision=33196

reactos/base/applications/dxdiag/display.c
reactos/base/applications/dxdiag/dxdiag.c
reactos/base/applications/dxdiag/precomp.h
reactos/base/applications/dxdiag/sound.c

index 946d46c..6824951 100644 (file)
@@ -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;
 
index 4f6c342..40ca45e 100644 (file)
@@ -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);
index 4e55a02..a418c3d 100644 (file)
@@ -20,6 +20,7 @@
 typedef struct
 {
     HWND hMainDialog;
+    HWND hTabCtrl;
     ULONG NumDisplayAdapter;
     HWND * hDisplayWnd;
     ULONG NumSoundAdapter;
index 00d6991..16199bb 100644 (file)
@@ -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++;