get next button to work

svn path=/trunk/; revision=46220
This commit is contained in:
Christoph von Wittich 2010-03-16 10:47:04 +00:00
parent c1e3362f03
commit fcec48b05b
2 changed files with 21 additions and 6 deletions

View file

@ -126,7 +126,6 @@ InitializeTabCtrl(HWND hwndDlg, PDXDIAG_CONTEXT pContext)
pContext->hDialogs[4] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_HELP_DIALOG), hTabCtrlWnd, HelpPageWndProc, (LPARAM)pContext); pContext->hDialogs[4] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_HELP_DIALOG), hTabCtrlWnd, HelpPageWndProc, (LPARAM)pContext);
/* insert tab ctrl items */ /* insert tab ctrl items */
InsertTabCtrlItem(hTabCtrlWnd, 0, MAKEINTRESOURCEW(IDS_SYSTEM_DIALOG)); InsertTabCtrlItem(hTabCtrlWnd, 0, MAKEINTRESOURCEW(IDS_SYSTEM_DIALOG));
InitializeDisplayAdapters(pContext); InitializeDisplayAdapters(pContext);
InitializeDirectSoundPage(pContext); InitializeDirectSoundPage(pContext);
@ -188,8 +187,19 @@ DxDiagWndProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
if (LOWORD(wParam) == IDC_BUTTON_NEXT) if (LOWORD(wParam) == IDC_BUTTON_NEXT)
{ {
//TODO INT CurSel;
/* handle next button */
/* 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; return TRUE;
} }
@ -210,6 +220,12 @@ DxDiagWndProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
pnmh = (LPNMHDR)lParam; pnmh = (LPNMHDR)lParam;
if ((pnmh->hwndFrom == hTabCtrlWnd) && (pnmh->idFrom == IDC_TAB_CONTROL) && (pnmh->code == TCN_SELCHANGE)) 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); TabCtrl_OnSelChange(pContext);
} }
break; break;

View file

@ -17,7 +17,6 @@ GetRegValue(HKEY hBaseKey, LPWSTR SubKey, LPWSTR ValueName, DWORD Type, LPWSTR R
DWORD dwType; DWORD dwType;
DWORD dwSize; DWORD dwSize;
if (RegOpenKeyExW(hBaseKey, SubKey, 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS) if (RegOpenKeyExW(hBaseKey, SubKey, 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
return FALSE; return FALSE;
@ -25,10 +24,10 @@ GetRegValue(HKEY hBaseKey, LPWSTR SubKey, LPWSTR ValueName, DWORD Type, LPWSTR R
res = RegQueryValueExW(hKey, ValueName, NULL, &dwType, (LPBYTE)Result, &dwSize); res = RegQueryValueExW(hKey, ValueName, NULL, &dwType, (LPBYTE)Result, &dwSize);
RegCloseKey(hKey); RegCloseKey(hKey);
if (dwType != Type) if (res != ERROR_SUCCESS)
return FALSE; return FALSE;
if (res != ERROR_SUCCESS) if (dwType != Type)
return FALSE; return FALSE;
if (Size == sizeof(DWORD)) if (Size == sizeof(DWORD))