BOOL CALLBACK PartitionPageDlgProc(HWND hwndDlg, UINT msg, WPARAM wp, LPARAM lp) { if (WizStep_Common_DlgProc (hwndDlg, msg, wp, lp)) return FALSE; switch (msg) { case WM_INITDIALOG: OnInitDialog(hwndDlg); CheckEnableButtons(); break; case WM_DESTROY_SHEET: Subclass_RemoveHook(g_pWiz->GetWindow(), WizardDlgProc); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDNEXT: if (SavePartitionInfo(TRUE)) g_pWiz->SetState(sidSTEP_NINE); break; case IDBACK: if (SavePartitionInfo(FALSE)) g_pWiz->SetState(sidSTEP_SEVEN); break; case IDC_CREATE_PARTITION: g_CfgData.configPartition = CS_CONFIGURE; CheckEnableButtons(); EnableDriveListCtrls(); break; case IDC_DONT_CREATE_PARTITION: g_CfgData.configPartition = CS_DONT_CONFIGURE; CheckEnableButtons(); EnableDriveListCtrls(FALSE); break; case IDC_PARTITION_NAME: if (HIWORD(wp) == EN_CHANGE) { OnPartitionName(); SetFocus((HWND)lp); } break; } break; case WM_NOTIFY: switch (((LPNMHDR)lp)->code) { case FLN_ITEMSELECT: OnListSelection((LPFLN_ITEMSELECT_PARAMS)lp); } break; } return FALSE; }
static void OnListSelection(LPFLN_ITEMSELECT_PARAMS pItemParms) { ASSERT(pItemParms); hSelectedItem = 0; if (pItemParms->hItem) { LPARAM lParam = FastList_GetItemParam(hDriveList, pItemParms->hItem); if (lParam == 0) { hSelectedItem = pItemParms->hItem; if (bAutoSetPartitionName) { LPCTSTR pDrive = FastList_GetItemText(hDriveList, hSelectedItem, 0); g_CfgData.szPartitionName[0] = _totlower(pDrive[0]); g_CfgData.szPartitionName[1] = 0; SetWndText(hDlg, IDC_PARTITION_NAME, g_CfgData.szPartitionName); // Must set this to true because the call to SetWndText will cause // a call to OnPartitionName, which would incorrectly think that the // Partition Name had been set by the user rather than by us, thus // setting bAutoSetPartitionName to false. bAutoSetPartitionName = TRUE; } } } CheckEnableButtons(); }
static void OnPartitionName() { TCHAR szBuf[MAX_PARTITION_NAME_LEN]; GetWindowText(GetDlgItem(hDlg, IDC_PARTITION_NAME), szBuf, MAX_PARTITION_NAME_LEN); bAutoSetPartitionName = szBuf[0] == 0; CheckEnableButtons(); }
/* * Dialog Procs _________________________________________________________________ * */ BOOL CALLBACK InfoPageDlgProc(HWND hRHS, UINT msg, WPARAM wp, LPARAM lp) { if (WizStep_Common_DlgProc (hRHS, msg, wp, lp)) return FALSE; switch (msg) { case WM_INITDIALOG: OnInitDialog(hRHS); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDNEXT: if (SavePageInfo()) g_pWiz->SetState (sidSTEP_THREE); break; case IDBACK: if (SavePageInfo()) g_pWiz->SetState (sidSTEP_ONE); break; case IDC_FIRST_SERVER: IsFirstServer(); break; case IDC_JOIN_EXISTING_CELL: IsFirstServer(FALSE); break; case IDC_CELL_NAME: case IDC_SERVER_PW: case IDC_VERIFY_PW: if (HIWORD(wp) == EN_CHANGE) CheckEnableButtons(); break; } break; } return FALSE; }
static void IsFirstServer(BOOL bIs) { ENABLE_STATE es; if (bIs) es = ES_ENABLE; else es = ES_DISABLE; SetEnable(hDlg, IDC_PRINCIPAL_LABEL, es); SetEnable(hDlg, IDC_PRINCIPAL, es); SetEnable(hDlg, IDC_SERVER_PW_FRAME, es); SetEnable(hDlg, IDC_SERVER_PW_LABEL, es); SetEnable(hDlg, IDC_SERVER_PW_PROMPT, es); SetEnable(hDlg, IDC_SERVER_PW, es); SetEnable(hDlg, IDC_VERIFY_PW_LABEL, es); SetEnable(hDlg, IDC_VERIFY_PW, es); CheckEnableButtons(); }