Author: cwittich
Date: Tue Mar 16 11:47:04 2010
New Revision: 46220
URL:
http://svn.reactos.org/svn/reactos?rev=46220&view=rev
Log:
[DXDIAG]
get next button to work
Modified:
trunk/reactos/base/applications/dxdiag/dxdiag.c
trunk/reactos/base/applications/dxdiag/system.c
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] Tue Mar 16 11:47:04 2010
@@ -126,7 +126,6 @@
pContext->hDialogs[4] = CreateDialogParamW(hInst,
MAKEINTRESOURCEW(IDD_HELP_DIALOG), hTabCtrlWnd, HelpPageWndProc, (LPARAM)pContext);
/* insert tab ctrl items */
-
InsertTabCtrlItem(hTabCtrlWnd, 0, MAKEINTRESOURCEW(IDS_SYSTEM_DIALOG));
InitializeDisplayAdapters(pContext);
InitializeDirectSoundPage(pContext);
@@ -188,8 +187,19 @@
if (LOWORD(wParam) == IDC_BUTTON_NEXT)
{
- //TODO
- /* handle next button */
+ INT CurSel;
+
+ /* retrieve current page */
+ CurSel = TabCtrl_GetCurSel(hTabCtrlWnd);
+ CurSel++;
+
+ /* enable/disable next button */
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_NEXT),
+ (CurSel != TabCtrl_GetItemCount(hTabCtrlWnd) - 1));
+
+ /* switch to next page */
+ SendMessageW(hTabCtrlWnd, TCM_SETCURSEL, CurSel, 0L);
+
return TRUE;
}
@@ -210,6 +220,12 @@
pnmh = (LPNMHDR)lParam;
if ((pnmh->hwndFrom == hTabCtrlWnd) && (pnmh->idFrom ==
IDC_TAB_CONTROL) && (pnmh->code == TCN_SELCHANGE))
{
+ INT CurSel = TabCtrl_GetCurSel(hTabCtrlWnd);
+
+ /* enable/disable next button */
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_NEXT),
+ (CurSel != TabCtrl_GetItemCount(hTabCtrlWnd) - 1));
+
TabCtrl_OnSelChange(pContext);
}
break;
Modified: trunk/reactos/base/applications/dxdiag/system.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/s…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/system.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/system.c [iso-8859-1] Tue Mar 16 11:47:04 2010
@@ -17,7 +17,6 @@
DWORD dwType;
DWORD dwSize;
-
if (RegOpenKeyExW(hBaseKey, SubKey, 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
return FALSE;
@@ -25,10 +24,10 @@
res = RegQueryValueExW(hKey, ValueName, NULL, &dwType, (LPBYTE)Result,
&dwSize);
RegCloseKey(hKey);
- if (dwType != Type)
- return FALSE;
-
if (res != ERROR_SUCCESS)
+ return FALSE;
+
+ if (dwType != Type)
return FALSE;
if (Size == sizeof(DWORD))