BOOL CALLBACK Services_StartStop_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { static LPSERVICE_STARTSTOP_PARAMS lpp = NULL; if (lpp != NULL) { if (AfsAppLib_HandleHelp ((lpp->fStart) ? IDD_SVC_START : IDD_SVC_STOP, hDlg, msg, wp, lp)) return TRUE; } switch (msg) { case WM_INITDIALOG: lpp = (LPSERVICE_STARTSTOP_PARAMS)lp; Services_StartStop_OnInitDialog (hDlg, lpp); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: Services_StartStop_OnOK (hDlg, lpp); EndDialog (hDlg, IDOK); break; case IDCANCEL: EndDialog (hDlg, IDCANCEL); break; } break; } return FALSE; }
BOOL CALLBACK NewAddr_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_SVR_NEWADDR, hDlg, msg, wp, lp)) return TRUE; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, lp); LPSOCKADDR_IN pAddr; if ((pAddr = (LPSOCKADDR_IN)GetWindowLongPtr (hDlg, DWLP_USER)) != NULL) { switch (msg) { case WM_INITDIALOG: NewAddr_OnInitDialog (hDlg, pAddr); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: NewAddr_OnOK (hDlg, pAddr); EndDialog (hDlg, IDOK); break; case IDCANCEL: EndDialog (hDlg, IDCANCEL); break; } break; } } return FALSE; }
BOOL CALLBACK Services_Delete_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_SVC_DELETE, hDlg, msg, wp, lp)) return TRUE; static LPIDENT lpi = NULL; if (msg == WM_INITDIALOG) lpi = (LPIDENT)lp; if (lpi != NULL) { switch (msg) { case WM_INITDIALOG: Services_Delete_OnInitDialog (hDlg, lpi); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: case IDCANCEL: EndDialog (hDlg, LOWORD(wp)); break; } break; case WM_DESTROY: lpi = NULL; break; } } return FALSE; }
BOOL WINAPI Server_Uninstall_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_SVR_UNINSTALL, hDlg, msg, wp, lp)) return TRUE; LPSVR_UNINSTALL_PARAMS lpp; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, lp); if ((lpp = (LPSVR_UNINSTALL_PARAMS)GetWindowLongPtr(hDlg,DWLP_USER)) != NULL) { switch (msg) { case WM_INITDIALOG: PropCache_Add (pcSVR_UNINSTALL, NULL, hDlg); Server_Uninstall_OnInitDialog (hDlg, lpp); break; case WM_ENDTASK: LPTASKPACKET ptp; if ((ptp = (LPTASKPACKET)lp) != NULL) { if (ptp->idTask == taskSVR_ENUM_TO_COMBOBOX) Server_Uninstall_OnEndTask_InitDialog (hDlg, ptp, lpp); FreeTaskPacket (ptp); } break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: Server_Uninstall_OnOK (hDlg); DestroyWindow (hDlg); break; case IDCANCEL: DestroyWindow (hDlg); break; case IDC_SERVER: case IDC_FILENAME: Server_Uninstall_EnableOK (hDlg); break; } break; case WM_DESTROY: SetWindowLongPtr (hDlg, DWLP_USER, 0); PropCache_Delete (pcSVR_UNINSTALL, NULL); Delete (lpp); break; } } return FALSE; }
BOOL CALLBACK Server_Salvage_Results_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_SVR_SALVAGE_RESULTS, hDlg, msg, wp, lp)) return TRUE; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, lp); LPIDENT lpi; if ((lpi = (LPIDENT)GetWindowLongPtr (hDlg, DWLP_USER)) != NULL) { switch (msg) { case WM_INITDIALOG: RECT rWindow; GetWindowRect (hDlg, &rWindow); ResizeWindow (hDlg, awdSalvageResults, rwaMoveToHere, &rWindow); Server_Salvage_Results_OnInitDialog (hDlg, lpi); break; case WM_SIZE: // if (lp==0), we're minimizing--don't call ResizeWindow(). if (lp != 0) ResizeWindow (hDlg, awdSalvageResults, rwaFixupGuts); break; case WM_ENDTASK: LPTASKPACKET ptp; if ((ptp = (LPTASKPACKET)lp) != NULL) { if (ptp->idTask == taskSVR_SALVAGE) Server_Salvage_OnEndTask_Salvage (hDlg, lpi, ptp); FreeTaskPacket (ptp); } break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: case IDCANCEL: DestroyWindow (hDlg); break; } break; case WM_CTLCOLOREDIT: if ((HWND)lp == GetDlgItem (hDlg, IDC_SALVAGE_DETAILS)) { SetBkColor ((HDC)wp, GetSysColor (COLOR_WINDOW)); return CreateSolidBrush (GetSysColor (COLOR_WINDOW))?TRUE:FALSE; } break; } } return FALSE; }
BOOL CALLBACK ChangeAddr_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_SVR_ADDRESS, hDlg, msg, wp, lp)) return TRUE; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, lp); LPSVR_CHANGEADDR_PARAMS lpp; if ((lpp = (LPSVR_CHANGEADDR_PARAMS)GetWindowLongPtr (hDlg, DWLP_USER)) != NULL) { switch (msg) { case WM_INITDIALOG: ChangeAddr_OnInitDialog (hDlg, lpp); StartTask (taskSVR_PROP_INIT, hDlg, lpp->lpiServer); break; case WM_ENDTASK: LPTASKPACKET ptp; if ((ptp = (LPTASKPACKET)lp) != NULL) { if (ptp->idTask == taskSVR_PROP_INIT) ChangeAddr_OnEndTask_Init (hDlg, lpp, ptp); FreeTaskPacket (ptp); } break; case WM_COMMAND: switch (LOWORD(wp)) { case IDC_SVR_ADDRESSES: if (HIWORD(wp) == LBN_SELCHANGE) ChangeAddr_OnSelect (hDlg); break; case IDC_ADDR_CHANGE: ChangeAddr_OnChange (hDlg, lpp); break; case IDC_ADDR_REMOVE: ChangeAddr_OnRemove (hDlg, lpp); break; case IDOK: EndDialog (hDlg, IDOK); break; case IDCANCEL: EndDialog (hDlg, IDCANCEL); break; } break; } } return FALSE; }
BOOL CALLBACK Filesets_Dump_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_SET_DUMP, hDlg, msg, wp, lp)) return TRUE; static LPSET_DUMP_PARAMS psdp = NULL; if (msg == WM_INITDIALOG) psdp = (LPSET_DUMP_PARAMS)lp; if (psdp != NULL) { switch (msg) { case WM_INITDIALOG: Filesets_Dump_OnInitDialog (hDlg, psdp); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: Filesets_Dump_OnOK (hDlg, psdp); EndDialog (hDlg, LOWORD(wp)); break; case IDCANCEL: EndDialog (hDlg, LOWORD(wp)); break; case IDC_DUMP_FULL: case IDC_DUMP_LIMIT_TIME: Filesets_Dump_OnSelect (hDlg); break; case IDC_DUMP_FILENAME: Filesets_Dump_EnableOK (hDlg); break; case IDC_DUMP_BROWSE: Filesets_Dump_OnBrowse (hDlg, psdp); break; } break; case WM_DESTROY: psdp = NULL; break; } } return FALSE; }
BOOL CALLBACK Group_Create_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_NEWGROUP, hDlg, msg, wp, lp)) return TRUE; switch (msg) { case WM_INITDIALOG: SetWindowLongPtr (hDlg, DWLP_USER, lp); Group_Create_OnInitDialog (hDlg); break; case WM_ENDTASK: LPTASKPACKET ptp; if ((ptp = (LPTASKPACKET)lp) != NULL) { if (ptp->idTask == taskOBJECT_GET) Group_Create_OnEndTask_ObjectGet (hDlg, ptp); FreeTaskPacket (ptp); } break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: if (Group_Create_OnOK (hDlg)) EndDialog (hDlg, IDOK); break; case IDCANCEL: EndDialog (hDlg, IDCANCEL); break; case IDC_ADVANCED: Group_Create_OnAdvanced (hDlg); break; case IDC_NEWGROUP_NAME: Group_Create_OnNames (hDlg); break; case IDC_NEWGROUP_ID_AUTO: case IDC_NEWGROUP_ID_MANUAL: Group_Create_OnID (hDlg); break; } break; } return FALSE; }
BOOL CALLBACK Server_SyncVLDB_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_SVR_SYNCVLDB, hDlg, msg, wp, lp)) return TRUE; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, lp); LPIDENT lpi; if ((lpi = (LPIDENT)GetWindowLongPtr (hDlg, DWLP_USER)) != NULL) { switch (msg) { case WM_INITDIALOG: PropCache_Add (pcSVR_SYNCVLDB, lpi, hDlg); Server_SyncVLDB_OnInitDialog (hDlg, lpi); break; case WM_ENDTASK: LPTASKPACKET ptp; if ((ptp = (LPTASKPACKET)lp) != NULL) { if (ptp->idTask == taskAGG_FIND_GHOST) Server_SyncVLDB_OnEndTask_Init (hDlg, ptp); FreeTaskPacket (ptp); } break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: Server_SyncVLDB_OnOK (hDlg, lpi); DestroyWindow (hDlg); break; case IDCANCEL: DestroyWindow (hDlg); break; } break; case WM_DESTROY: PropCache_Delete (pcSVR_SYNCVLDB, lpi); break; } } return FALSE; }
HRESULT CALLBACK BadCreds_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { LPREALBADCREDSDLG_PARAMS lpp; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, lp); if ((lpp = (LPREALBADCREDSDLG_PARAMS)GetWindowLongPtr (hDlg, DWLP_USER)) != NULL) { if (lpp->bcdp.hookproc) { if (CallWindowProc ((WNDPROC)lpp->bcdp.hookproc, hDlg, msg, wp, lp)) return TRUE; } if (AfsAppLib_HandleHelp (lpp->bcdp.idd, hDlg, msg, wp, lp)) return TRUE; } switch (msg) { case WM_INITDIALOG: TCHAR szApplication[ cchNAME ]; AfsAppLib_GetAppName (szApplication); if (szApplication[0] != TEXT('\0')) { TCHAR szTitle[ cchRESOURCE ]; GetWindowText (hDlg, szTitle, cchRESOURCE); lstrcat (szTitle, TEXT(" - ")); lstrcat (szTitle, szApplication); SetWindowText (hDlg, szTitle); } if (!lpp || !lpp->bcdp.pfShowWarningEver) DestroyWindow (GetWindow (hDlg, IDC_BADCREDS_SHUTUP)); SetDlgItemText (hDlg, IDC_BADCREDS_DESC, lpp->pszFullText); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: case IDCANCEL: if (lpp && lpp->bcdp.pfShowWarningEver) *lpp->bcdp.pfShowWarningEver = !IsDlgButtonChecked (hDlg, IDC_BADCREDS_SHUTUP); EndDialog (hDlg, LOWORD(wp)); break; } break; } return FALSE; }
/* * Dialog Proc _________________________________________________________________ * */ BOOL CALLBACK ServicesPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { if (AfsAppLib_HandleHelp(IDD_SERVICES_PAGE, hwndDlg, uMsg, wParam, lParam)) return TRUE; switch (uMsg) { case WM_INITDIALOG: OnInitDialog(hwndDlg); break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_DB_SERVICE: OnDbService(); break; case IDC_BK_SERVICE: OnBakService(); break; case IDC_FS_SERVICE: OnFsService(); break; case IDC_SCC: OnScClient(); break; case IDC_SCS: OnScServer(); break; case IDC_SC_MACHINE: if (HIWORD(wParam) == EN_CHANGE) { OnScMachineChange(); } break; case IDAPPLY: PrepareToConfig(); break; } break; } CheckEnableApply(); return FALSE; }
HRESULT CALLBACK NewCreds_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { LPCREDENTIALSDLG_PARAMS lpp; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, lp); if ((lpp = (LPCREDENTIALSDLG_PARAMS)GetWindowLongPtr (hDlg, DWLP_USER)) != NULL) { if (lpp->hookproc) { if (CallWindowProc ((WNDPROC)lpp->hookproc, hDlg, msg, wp, lp)) return TRUE; } } if (lpp != NULL) { if (AfsAppLib_HandleHelp (lpp->idd, hDlg, msg, wp, lp)) return TRUE; } switch (msg) { case WM_INITDIALOG: NewCreds_OnInitDialog (hDlg, lpp); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDCANCEL: EndDialog (hDlg, IDCANCEL); return TRUE; case IDOK: if (NewCreds_OnOK (hDlg, lpp)) EndDialog (hDlg, IDOK); return TRUE; case IDC_CREDS_LOGIN: NewCreds_OnLogin (hDlg); break; } break; } return FALSE; }
/* * Dialog Proc _________________________________________________________________ * */ BOOL CALLBACK SalvageDlgProc(HWND hwndDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp(IDD_SALVAGE, hwndDlg, msg, wp, lp)) return TRUE; switch (msg) { case WM_INITDIALOG: OnInitDialog(hwndDlg); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDC_VOLUME_NAME: case IDC_NUM_PROCESSES: case IDC_LOG_FILE: case IDC_TEMP_DIR: if (HIWORD(wp) == EN_CHANGE) UpdateControls(); break; case IDC_SERVER: case IDC_PARTITION: case IDC_VOLUME: case IDC_NUM_PROCESSES_CHECKBOX: UpdateControls(); break; case IDC_ADVANCED: OnAdvanced(); break; case IDCANCEL: EndDialog(hDlg, IDCANCEL); break; case IDOK: if (OnSalvage()) EndDialog(hDlg, IDOK); break; } break; } return FALSE; }
BOOL CALLBACK Options_General_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_OPTIONS_GENERAL, hDlg, msg, wp, lp)) return TRUE; switch (msg) { case WM_INITDIALOG_SHEET: PropCache_Add (pcGENERAL, 0, hDlg); break; case WM_DESTROY_SHEET: PropCache_Delete (hDlg); break; case WM_INITDIALOG: PropCache_Add (pcGENERAL, NULL, hDlg); Options_General_OnInitDialog (hDlg); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDAPPLY: Options_General_OnApply (hDlg); break; case IDC_OPT_SVR_LONGNAMES: case IDC_OPT_SVR_DBL_PROP: case IDC_OPT_SVR_DBL_DEPENDS: case IDC_OPT_SVR_DBL_OPEN: case IDC_OPT_SVR_OPENMON: case IDC_OPT_SVR_CLOSEUNMON: case IDC_OPT_WARN_BADCREDS: PropSheetChanged (hDlg); break; } break; } return FALSE; }
BOOL CALLBACK Server_AddHost_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_SVR_ADDHOST, hDlg, msg, wp, lp)) return TRUE; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, lp); LPSVR_ADDHOST_PARAMS lpp; if ((lpp = (LPSVR_ADDHOST_PARAMS)GetWindowLongPtr (hDlg, DWLP_USER)) != NULL) { switch (msg) { case WM_INITDIALOG: Server_AddHost_OnInitDialog (hDlg, lpp); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: GetDlgItemText (hDlg, IDC_ADDHOST_HOST, lpp->szHost, cchNAME); EndDialog (hDlg, LOWORD(wp)); break; case IDCANCEL: EndDialog (hDlg, LOWORD(wp)); break; case IDC_ADDHOST_HOST: Server_AddHost_EnableOK (hDlg); break; } break; } } return FALSE; }
BOOL CALLBACK Filesets_Release_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_SET_RELEASE, hDlg, msg, wp, lp)) return TRUE; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, lp); LPIDENT lpi; if ((lpi = (LPIDENT)GetWindowLongPtr (hDlg, DWLP_USER)) != NULL) { switch (msg) { case WM_INITDIALOG: PropCache_Add (pcSET_RELEASE, lpi, hDlg); Filesets_Release_OnInitDialog (hDlg, lpi); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: Filesets_Release_OnOK (hDlg, lpi); DestroyWindow (hDlg); break; case IDCANCEL: DestroyWindow (hDlg); break; } break; case WM_DESTROY: PropCache_Delete (pcSET_RELEASE, lpi); break; } } return FALSE; }
BOOL CALLBACK Server_Scout_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_SVR_SCOUT, hDlg, msg, wp, lp)) return TRUE; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, ((LPPROPSHEETPAGE)lp)->lParam); LPIDENT lpiServer = (LPIDENT)GetWindowLongPtr (hDlg, DWLP_USER); switch (msg) { case WM_INITDIALOG: Server_Scout_OnInitDialog (hDlg, lpiServer); StartTask (taskSVR_SCOUT_INIT, hDlg, lpiServer); break; case WM_ENDTASK: LPTASKPACKET ptp; if ((ptp = (LPTASKPACKET)lp) != NULL) { if (ptp->idTask == taskSVR_SCOUT_INIT) Server_Scout_OnEndTask_InitDialog (hDlg, ptp); else if (ptp->idTask == taskSVR_SCOUT_APPLY) Server_Scout_OnEndTask_Apply (hDlg, ptp); FreeTaskPacket (ptp); } break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: case IDCANCEL: break; case IDAPPLY: Server_Scout_OnApply (hDlg, lpiServer); break; case IDC_SVR_WARN_AGGFULL: Server_Scout_OnAggWarn (hDlg, lpiServer); PropSheetChanged (hDlg); break; case IDC_SVR_WARN_SETFULL: Server_Scout_OnSetWarn (hDlg, lpiServer); PropSheetChanged (hDlg); break; case IDC_SVR_WARN_AGGALLOC: case IDC_SVR_WARN_SVCSTOP: case IDC_SVR_WARN_TIMEOUT: case IDC_SVR_WARN_SETNOVLDB: case IDC_SVR_WARN_SETNOSERV: case IDC_SVR_WARN_AGGFULL_PERCENT: case IDC_SVR_WARN_SETFULL_PERCENT: case IDC_SVR_AUTOREFRESH_MINUTES: PropSheetChanged (hDlg); break; case IDC_SVR_AUTOREFRESH: Server_Scout_OnAutoRefresh (hDlg, lpiServer); PropSheetChanged (hDlg); break; } break; } return FALSE; }
BOOL CALLBACK Server_General_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_SVR_GENERAL, hDlg, msg, wp, lp)) return TRUE; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, ((LPPROPSHEETPAGE)lp)->lParam); LPIDENT lpiServer = (LPIDENT)GetWindowLongPtr (hDlg, DWLP_USER); switch (msg) { case WM_INITDIALOG_SHEET: PropCache_Add (pcSVR_PROP, (LPIDENT)lp, hDlg); break; case WM_DESTROY_SHEET: PropCache_Delete (hDlg); break; case WM_INITDIALOG: Server_General_OnInitDialog (hDlg, lpiServer); StartTask (taskSVR_PROP_INIT, hDlg, lpiServer); break; case WM_DESTROY: SetWindowLongPtr (hDlg, DWLP_USER, 0); break; case WM_ENDTASK: LPTASKPACKET ptp; if ((ptp = (LPTASKPACKET)lp) != NULL) { if (ptp->idTask == taskSVR_PROP_INIT) Server_General_OnEndTask_InitDialog (hDlg, lpiServer, ptp); FreeTaskPacket (ptp); } break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: case IDCANCEL: break; case IDC_SVR_AUTH_YES: Server_General_OnAuth (hDlg, lpiServer, TRUE); break; case IDC_SVR_AUTH_NO: Server_General_OnAuth (hDlg, lpiServer, FALSE); break; case IDC_SVR_CHANGEADDR: Server_General_OnChangeAddr (hDlg, lpiServer); break; } break; case WM_CTLCOLORLISTBOX: if ((HWND)lp == GetDlgItem (hDlg, IDC_SVR_ADDRESSES)) { SetBkColor ((HDC)wp, GetSysColor (COLOR_BTNFACE)); return CreateSolidBrush (GetSysColor (COLOR_BTNFACE))?TRUE:FALSE; } break; } return FALSE; }
BOOL CALLBACK Server_Hosts_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_SVR_HOSTS, hDlg, msg, wp, lp)) return TRUE; LPSVR_HOSTS_PARAMS lpp; if ((msg == WM_INITDIALOG_SHEET) || (msg == WM_DESTROY_SHEET)) lpp = (LPSVR_HOSTS_PARAMS)lp; else lpp = (LPSVR_HOSTS_PARAMS)PropSheet_FindTabParam (hDlg); switch (msg) { case WM_INITDIALOG_SHEET: PropCache_Add (pcSVR_HOSTS, lpp->lpiServer, hDlg); break; case WM_DESTROY_SHEET: PropCache_Delete (hDlg); break; case WM_INITDIALOG: Server_Hosts_OnInitDialog (hDlg, lpp); break; case WM_DESTROY: Server_Hosts_Free (lpp); break; case WM_ENDTASK: LPTASKPACKET ptp; if ((ptp = (LPTASKPACKET)lp) != NULL) { if (ptp->idTask == taskSVR_HOSTLIST_OPEN) Server_Hosts_OnEndTask_ListOpen (hDlg, lpp, ptp); FreeTaskPacket (ptp); } break; case WM_COMMAND: switch (LOWORD(wp)) { case IDAPPLY: Server_Hosts_OnApply (hDlg, lpp); break; case IDC_HOST_ADD: Server_Hosts_OnAddEntry (hDlg, lpp); PropSheetChanged (hDlg); break; case IDC_HOST_REMOVE: Server_Hosts_OnDelEntry (hDlg, lpp); PropSheetChanged (hDlg); break; } break; case WM_NOTIFY: switch (((LPNMHDR)lp)->code) { case FLN_ITEMSELECT: if (((LPNMHDR)lp)->hwndFrom == GetDlgItem (hDlg, IDC_HOST_LIST)) { Server_Hosts_OnSelect (hDlg, lpp); } break; } break; } return FALSE; }
BOOL CALLBACK Server_Salvage_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_SVR_SALVAGE, hDlg, msg, wp, lp)) return TRUE; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, lp); LPIDENT lpi; if ((lpi = (LPIDENT)GetWindowLongPtr (hDlg, DWLP_USER)) != NULL) { switch (msg) { case WM_INITDIALOG: PropCache_Add (pcSVR_SALVAGE, lpi, hDlg); Server_Salvage_OnInitDialog (hDlg, lpi); Server_Salvage_OnAdvanced (hDlg); break; case WM_ENDTASK: LPTASKPACKET ptp; if ((ptp = (LPTASKPACKET)lp) != NULL) { if (ptp->idTask == taskSVR_ENUM_TO_COMBOBOX) Server_Salvage_OnEndTask_EnumServers (hDlg, lpi, ptp); else if (ptp->idTask == taskAGG_ENUM_TO_COMBOBOX) Server_Salvage_OnEndTask_EnumAggregates (hDlg, lpi, ptp); else if (ptp->idTask == taskSET_ENUM_TO_COMBOBOX) Server_Salvage_OnEndTask_EnumFilesets (hDlg, lpi, ptp); FreeTaskPacket (ptp); } break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: Server_Salvage_OnOK (hDlg); case IDCANCEL: DestroyWindow (hDlg); break; case IDC_SERVER: Server_Salvage_OnServer (hDlg, lpi); break; case IDC_AGGREGATE: Server_Salvage_OnAggregate (hDlg, lpi); break; case IDC_AGGREGATE_ALL: Server_Salvage_OnAllAggregates (hDlg); break; case IDC_FILESET_ALL: Server_Salvage_OnAllFilesets (hDlg); break; case IDC_SALVAGE_SIMUL: Server_Salvage_OnSimultaneous (hDlg); break; case IDC_ADVANCED: Server_Salvage_OnAdvanced (hDlg); break; } break; case WM_DESTROY: PropCache_Delete (pcSVR_SALVAGE, lpi); break; } } return FALSE; }
HRESULT CALLBACK OpenCell_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { LPOPENCELLDLG_PARAMS lpp; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, lp); if ((lpp = (LPOPENCELLDLG_PARAMS)GetWindowLongPtr (hDlg, DWLP_USER)) != NULL) { if (lpp->hookproc) { if (CallWindowProc ((WNDPROC)lpp->hookproc, hDlg, msg, wp, lp)) return TRUE; } } if (lpp != NULL) { if (AfsAppLib_HandleHelp (lpp->idd, hDlg, msg, wp, lp)) return TRUE; } switch (msg) { case WM_INITDIALOG: OpenCell_OnInitDialog (hDlg, lpp); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDCANCEL: EndDialog (hDlg, IDCANCEL); return TRUE; case IDOK: if (OpenCell_OnOK (hDlg, lpp)) EndDialog (hDlg, IDOK); return TRUE; case IDC_OPENCELL_CELL: switch (HIWORD(wp)) { case CBN_SELCHANGE: TCHAR szCell[ cchNAME ]; SendDlgItemMessage (hDlg, IDC_OPENCELL_CELL, CB_GETLBTEXT, CB_GetSelected(GetDlgItem (hDlg, IDC_OPENCELL_CELL)), (LPARAM)szCell); SetDlgItemText (hDlg, IDC_OPENCELL_CELL, szCell); OpenCell_OnCell (hDlg); break; case CBN_EDITCHANGE: OpenCell_OnCell (hDlg); break; } break; } break; case WM_REFRESHED_CREDENTIALS: OpenCell_OnGotCreds (hDlg, lp); break; } return FALSE; }
BOOL CALLBACK Filesets_Create_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { static LPSET_CREATE_PARAMS pscp = NULL; if (msg == WM_INITDIALOG) pscp = (LPSET_CREATE_PARAMS)lp; if (HandleColumnNotify (hDlg, msg, wp, lp, &gr.viewAggCreate)) return FALSE; if (AfsAppLib_HandleHelp (IDD_SET_CREATE, hDlg, msg, wp, lp)) return TRUE; if (pscp != NULL) { switch (msg) { case WM_INITDIALOG: FastList_SetTextCallback (GetDlgItem (hDlg, IDC_AGG_LIST), GetItemText, &gr.viewAggCreate); Filesets_Create_OnInitDialog (hDlg, pscp); break; case WM_CONTEXTMENU: HWND hList; hList = GetDlgItem (hDlg, IDC_AGG_LIST); POINT ptScreen; POINT ptClient; ptScreen.x = LOWORD(lp); ptScreen.y = HIWORD(lp); ptClient = ptScreen; ScreenToClient (hList, &ptClient); if (FL_HitTestForHeaderBar (hList, ptClient)) { HMENU hm = TaLocale_LoadMenu (MENU_COLUMNS); DisplayContextMenu (hm, ptScreen, hList); } break; case WM_ENDTASK: LPTASKPACKET ptp; if ((ptp = (LPTASKPACKET)lp) != NULL) { if (ptp->idTask == taskAGG_FIND_QUOTA_LIMITS) Filesets_Create_OnEndTask_FindQuotaLimits (hDlg, ptp, pscp); else if (ptp->idTask == taskAGG_ENUM_TO_LISTVIEW) Filesets_Create_OnEndTask_EnumAggregates (hDlg); else if (ptp->idTask == taskSVR_ENUM_TO_COMBOBOX) { EnableWindow (GetDlgItem (hDlg, IDC_SET_SERVER), TRUE); Filesets_Create_StartDisplay_Aggregates (hDlg, &pscp->lpiParent); } FreeTaskPacket (ptp); } break; case WM_COLUMNS_CHANGED: LPARAM lpSel; lpSel = FL_GetSelectedData (GetDlgItem (hDlg, IDC_AGG_LIST)); FL_RestoreView (GetDlgItem (hDlg, IDC_AGG_LIST), &gr.viewAggCreate); Filesets_Create_OnSelectServer (hDlg, (LPIDENT*)&lpSel); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: if (pscp->lpiParent && pscp->lpiParent->fIsAggregate() && pscp->szName[0]) EndDialog (hDlg, LOWORD(wp)); break; case IDCANCEL: EndDialog (hDlg, LOWORD(wp)); break; case IDC_SET_SERVER: if (HIWORD(wp) == CBN_SELCHANGE) Filesets_Create_OnSelectServer (hDlg, &pscp->lpiParent); break; case IDC_SET_NAME: GetDlgItemText (hDlg, IDC_SET_NAME, pscp->szName, cchNAME); Filesets_Create_EnableOK (hDlg, pscp); break; case IDC_SET_QUOTA: if (HIWORD(wp) == SPN_UPDATE) { pscp->ckQuota = SP_GetPos (GetDlgItem (hDlg, IDC_SET_QUOTA)); if (gr.cbQuotaUnits == cb1MB) pscp->ckQuota *= ck1MB; } break; case IDC_SET_QUOTA_UNITS: if (HIWORD(wp) == CBN_SELCHANGE) { gr.cbQuotaUnits = (size_t)CB_GetSelectedData (GetDlgItem (hDlg, IDC_SET_QUOTA_UNITS)); StartTask (taskAGG_FIND_QUOTA_LIMITS, hDlg, pscp->lpiParent); } break; case IDC_SET_CLONE: pscp->fCreateClone = IsDlgButtonChecked (hDlg, IDC_SET_CLONE); break; } break; case WM_DESTROY: FL_StoreView (GetDlgItem (hDlg, IDC_AGG_LIST), &gr.viewAggCreate); pscp = NULL; break; case WM_NOTIFY: switch (((LPNMHDR)lp)->code) { case FLN_ITEMSELECT: LPIDENT lpi; if ((lpi = (LPIDENT)FL_GetSelectedData (GetDlgItem (hDlg, IDC_AGG_LIST))) != NULL) { pscp->lpiParent = lpi; StartTask (taskAGG_FIND_QUOTA_LIMITS, hDlg, pscp->lpiParent); Filesets_Create_EnableOK (hDlg, pscp); } break; } break; } } return FALSE; }
BOOL CALLBACK Filesets_Restore_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { static LPSET_RESTORE_PARAMS psrp = NULL; if (msg == WM_INITDIALOG) psrp = (LPSET_RESTORE_PARAMS)lp; if (HandleColumnNotify (hDlg, msg, wp, lp, &gr.viewAggRestore)) return FALSE; if (AfsAppLib_HandleHelp (IDD_SET_RESTORE, hDlg, msg, wp, lp)) return TRUE; if (psrp != NULL) { switch (msg) { case WM_INITDIALOG: FastList_SetTextCallback (GetDlgItem (hDlg, IDC_AGG_LIST), GetItemText, &gr.viewAggRestore); Filesets_Restore_OnInitDialog (hDlg, psrp); break; case WM_CONTEXTMENU: HWND hList; hList = GetDlgItem (hDlg, IDC_AGG_LIST); POINT ptScreen; POINT ptClient; ptScreen.x = LOWORD(lp); ptScreen.y = HIWORD(lp); ptClient = ptScreen; ScreenToClient (hList, &ptClient); if (FL_HitTestForHeaderBar (hList, ptClient)) { HMENU hm = TaLocale_LoadMenu (MENU_COLUMNS); DisplayContextMenu (hm, ptScreen, hList); } break; case WM_ENDTASK: LPTASKPACKET ptp; if ((ptp = (LPTASKPACKET)lp) != NULL) { if (ptp->idTask == taskSET_LOOKUP) Filesets_Restore_OnEndTask_LookupFileset (hDlg, ptp, psrp); else if (ptp->idTask == taskSVR_ENUM_TO_COMBOBOX) Filesets_Restore_OnEndTask_EnumServers (hDlg, psrp); else if (ptp->idTask == taskAGG_ENUM_TO_LISTVIEW) Filesets_Restore_OnEndTask_EnumAggregates (hDlg, psrp); FreeTaskPacket (ptp); } break; case WM_COLUMNS_CHANGED: LPARAM lpSel; lpSel = FL_GetSelectedData (GetDlgItem (hDlg, IDC_AGG_LIST)); FL_RestoreView (GetDlgItem (hDlg, IDC_AGG_LIST), &gr.viewAggRestore); Filesets_Restore_OnSelectServer (hDlg, psrp); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: case IDCANCEL: EndDialog (hDlg, LOWORD(wp)); break; case IDC_RESTORE_INCREMENTAL: psrp->fIncremental = IsDlgButtonChecked (hDlg, IDC_RESTORE_INCREMENTAL); break; case IDC_RESTORE_SERVER: if (HIWORD(wp) == CBN_SELCHANGE) Filesets_Restore_OnSelectServer (hDlg, psrp); break; case IDC_RESTORE_SETNAME: if (HIWORD(wp) == EN_UPDATE) Filesets_Restore_OnSetName (hDlg, psrp); break; case IDC_RESTORE_FILENAME: Filesets_Restore_OnFileName (hDlg, psrp); break; case IDC_RESTORE_BROWSE: Filesets_Restore_OnBrowse (hDlg, psrp); break; } break; case WM_DESTROY: FL_StoreView (GetDlgItem (hDlg, IDC_AGG_LIST), &gr.viewAggRestore); psrp = NULL; break; case WM_NOTIFY: switch (((LPNMHDR)lp)->code) { case FLN_ITEMSELECT: Filesets_Restore_OnAggregate (hDlg, psrp); break; } break; } } return FALSE; }
BOOL CALLBACK Aggregates_General_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_AGG_GENERAL, hDlg, msg, wp, lp)) return TRUE; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, ((LPPROPSHEETPAGE)lp)->lParam); LPIDENT lpi = (LPIDENT)GetWindowLongPtr (hDlg, DWLP_USER); switch (msg) { case WM_INITDIALOG_SHEET: PropCache_Add (pcAGG_PROP, (LPIDENT)lp, hDlg); break; case WM_DESTROY_SHEET: PropCache_Delete (hDlg); break; case WM_INITDIALOG: Aggregates_General_OnInitDialog (hDlg); StartTask (taskAGG_PROP_INIT, hDlg, lpi); break; case WM_ENDTASK: LPTASKPACKET ptp; if ((ptp = (LPTASKPACKET)lp) != NULL) { if (ptp->idTask == taskAGG_PROP_INIT) Aggregates_General_OnEndTask_InitDialog (hDlg, ptp); else if (ptp->idTask == taskAGG_PROP_APPLY) Aggregates_General_OnEndTask_Apply (hDlg, ptp); FreeTaskPacket (ptp); } break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: case IDCANCEL: break; case IDAPPLY: Aggregates_General_OnApply (hDlg); break; case IDC_AGG_WARNALLOC: PropSheetChanged (hDlg); break; case IDC_AGG_WARN: case IDC_AGG_WARN_AGGFULL: case IDC_AGG_WARN_AGGFULL_DEF: Aggregates_General_OnWarnings (hDlg); PropSheetChanged (hDlg); break; case IDC_AGG_WARN_AGGFULL_PERCENT: PropSheetChanged (hDlg); break; } break; } return FALSE; }
BOOL CALLBACK Filesets_General_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_SET_GENERAL, hDlg, msg, wp, lp)) return TRUE; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, ((LPPROPSHEETPAGE)lp)->lParam); LPIDENT lpi = (LPIDENT)GetWindowLongPtr (hDlg, DWLP_USER); switch (msg) { case WM_INITDIALOG_SHEET: PropCache_Add (pcSET_PROP, (LPIDENT)lp, hDlg); break; case WM_DESTROY_SHEET: PropCache_Delete (hDlg); break; case WM_INITDIALOG: Filesets_General_OnInitDialog (hDlg, lpi); StartTask (taskSET_PROP_INIT, hDlg, lpi); NotifyMe (WHEN_OBJECT_CHANGES, lpi, hDlg, 0); break; case WM_DESTROY: DontNotifyMeEver (hDlg); break; case WM_ENDTASK: LPTASKPACKET ptp; if ((ptp = (LPTASKPACKET)lp) != NULL) { if (ptp->idTask == taskSET_PROP_INIT) Filesets_General_OnEndTask_InitDialog (hDlg, ptp, lpi); FreeTaskPacket (ptp); } break; case WM_NOTIFY_FROM_DISPATCH: StartTask (taskSET_PROP_INIT, hDlg, lpi); Delete ((LPNOTIFYSTRUCT)lp); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: case IDCANCEL: break; case IDAPPLY: Filesets_General_OnApply (hDlg, lpi); break; case IDC_SET_WARN: case IDC_SET_WARN_SETFULL: case IDC_SET_WARN_SETFULL_DEF: Filesets_General_OnWarnings (hDlg, lpi); PropSheetChanged (hDlg); break; case IDC_SET_WARN_SETFULL_PERCENT: PropSheetChanged (hDlg); break; case IDC_SET_QUOTA: if (Filesets_SetQuota (lpi)) { // this new task will block until the setquota req is done StartTask (taskSET_PROP_INIT, hDlg, lpi); } break; case IDC_SET_LOCK: StartTask (taskSET_LOCK, NULL, lpi); break; case IDC_SET_UNLOCK: StartTask (taskSET_UNLOCK, NULL, lpi); break; } break; } return FALSE; }
BOOL CALLBACK Columns_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_COLUMNS, hDlg, msg, wp, lp)) return TRUE; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, ((LPPROPSHEETPAGE)lp)->lParam); ShowColumnsParams *pscp; pscp = (ShowColumnsParams *)GetWindowLongPtr (hDlg, DWLP_USER); switch (msg) { case WM_INITDIALOG: Columns_OnInitDialog (hDlg, (pscp) ? pscp->lpviDefault : NULL); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDAPPLY: Columns_OnApply (hDlg); break; case IDOK: case IDCANCEL: EndDialog (hDlg, LOWORD(wp)); break; case IDC_COLUMNS: if (HIWORD(wp) == CBN_SELCHANGE) { Columns_OnSelect (hDlg); } break; case IDC_COL_AVAIL: if (HIWORD(wp) == LBN_SELCHANGE) { Columns_OnSelAvail (hDlg); } break; case IDC_COL_SHOWN: if (HIWORD(wp) == LBN_SELCHANGE) { Columns_OnSelShown (hDlg); } break; case IDC_COL_INSERT: Columns_OnInsert (hDlg); break; case IDC_COL_DELETE: Columns_OnDelete (hDlg); break; case IDC_COL_UP: Columns_OnMoveUp (hDlg); break; case IDC_COL_DOWN: Columns_OnMoveDown (hDlg); break; } break; } return FALSE; }
BOOL CALLBACK Browse_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { LPBROWSE_PARAMS lpp; if ((lpp = (LPBROWSE_PARAMS)GetWindowLongPtr (hDlg, DWLP_USER)) != NULL) { if (AfsAppLib_HandleHelp (lpp->iddForHelp, hDlg, msg, wp, lp)) return FALSE; } switch (msg) { case WM_INITDIALOG: SetWindowLongPtr (hDlg, DWLP_USER, lp); Browse_OnInitDialog (hDlg); l.dwTickLastType = 0; break; case WM_ENDTASK: LPTASKPACKET ptp; if ((ptp = (LPTASKPACKET)lp) != NULL) { if ((ptp->idTask == taskUSER_ENUM) || (ptp->idTask == taskGROUP_ENUM)) Browse_OnEndTask_EnumObjects (hDlg, ptp); else if (ptp->idTask == taskLIST_TRANSLATE) Browse_OnEndTask_Translate (hDlg, ptp); FreeTaskPacket (ptp); } break; case WM_TIMER: switch (wp) { case ID_SEARCH_TIMER: if ( (l.dwTickLastType) && (GetTickCount() > l.dwTickLastType + msecSEARCH_TIMER) ) { KillTimer (hDlg, ID_SEARCH_TIMER); Browse_UpdateDialog (hDlg); } break; } break; case WM_COMMAND: switch (LOWORD(wp)) { case IDC_BROWSE_SELECT: Browse_OnOK (hDlg); break; case IDCANCEL: EndDialog (hDlg, IDCANCEL); break; case IDC_BROWSE_CHECK: Browse_UpdateDialog (hDlg); break; case IDC_BROWSE_COMBO: if (HIWORD(wp) == CBN_SELCHANGE) { SetDlgItemText (hDlg, IDC_BROWSE_NAMED, TEXT("")); Browse_UpdateDialog (hDlg); } break; case IDC_BROWSE_RESTART: Browse_UpdateDialog (hDlg); PostMessage (hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem (hDlg, IDC_BROWSE_NAMED), (LPARAM)TRUE); break; case IDC_BROWSE_NAMED: if (HIWORD(wp) == EN_UPDATE) // has the user hit Enter here? { TCHAR szTest[ 1024 ]; GetDlgItemText (hDlg, IDC_BROWSE_NAMED, szTest, 1024); if ((lstrlen (szTest)) && (szTest[lstrlen(szTest)-1]==TEXT('\n'))) { szTest[ lstrlen(szTest)-1 ] = TEXT('\0'); if ((lstrlen (szTest)) && (szTest[lstrlen(szTest)-1]==TEXT('\r'))) szTest[ lstrlen(szTest)-1 ] = TEXT('\0'); SetDlgItemText (hDlg, IDC_BROWSE_NAMED, szTest); PostMessage (hDlg, WM_COMMAND, MAKELONG(IDC_BROWSE_SELECT,BN_CLICKED), (LPARAM)GetDlgItem(hDlg,IDC_BROWSE_SELECT)); } } break; case IDC_BROWSE_PATTERN: if (HIWORD(wp) == EN_UPDATE) { l.dwTickLastType = GetTickCount(); KillTimer (hDlg, ID_SEARCH_TIMER); SetTimer (hDlg, ID_SEARCH_TIMER, msecSEARCH_TIMER +15, NULL); } break; } break; case WM_NOTIFY: switch (((LPNMHDR)lp)->code) { case FLN_ITEMSELECT: Browse_OnSelect (hDlg); break; case FLN_LDBLCLICK: PostMessage (hDlg, WM_COMMAND, MAKELONG(IDC_BROWSE_SELECT,BN_CLICKED), (LPARAM)GetDlgItem (hDlg, IDC_BROWSE_SELECT)); break; } break; } return FALSE; }
HRESULT CALLBACK DlgProc_Browse (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { BROWSEDIALOGPARAMS *pbdp; if (AfsAppLib_HandleHelp (IDD_APPLIB_BROWSE, hDlg, msg, wp, lp)) { return FALSE; } if (msg == WM_INITDIALOG) { SetWindowLongPtr (hDlg, DWLP_USER, lp); } if ((pbdp = (BROWSEDIALOGPARAMS *)GetWindowLongPtr (hDlg, DWLP_USER)) != NULL) { switch (msg) { case WM_INITDIALOG: DlgProc_Browse_OnInitDialog (hDlg, pbdp); break; case WM_NOTIFY: switch (((LPNMHDR)lp)->code) { case LVN_ITEMCHANGED: if ( ((LPNM_LISTVIEW)lp)->uNewState & LVIS_SELECTED ) { DlgProc_Browse_SelectedEntry (hDlg, pbdp); } break; case NM_DBLCLK: PostMessage (hDlg, WM_COMMAND, MAKELONG(IDC_BROWSE_SELECT,BN_CLICKED), (LPARAM)GetDlgItem(hDlg,IDC_BROWSE_SELECT)); break; } break; case WM_DESTROY: DlgProc_Browse_StopSearch (pbdp); if (pbdp->hImages != NULL) { ListView_SetImageList (GetDlgItem (hDlg, IDC_BROWSE_LIST), 0, 0); ImageList_Destroy (pbdp->hImages); } break; case WM_FOUNDNAME: { LPTSTR pszName = (LPTSTR)lp; if (pszName != NULL) { HWND hList = GetDlgItem (hDlg, IDC_BROWSE_LIST); LV_AddItem (hList, 1, INDEX_SORT, 0, 0, pszName); FreeString (pszName); } break; } case WM_THREADSTART: { TCHAR szText[ cchRESOURCE ]; GetString (szText, IDS_BROWSE_WAITING); SetDlgItemText (pbdp->hDlg, IDC_BROWSE_STATUS, szText); break; } case WM_THREADDONE: { SetDlgItemText (pbdp->hDlg, IDC_BROWSE_STATUS, TEXT("")); break; } case WM_COMMAND: switch (LOWORD(wp)) { case IDCANCEL: EndDialog (hDlg, LOWORD(wp)); break; case IDC_BROWSE_SELECT: if ( (GetDlgItem (pbdp->hDlg, IDC_BROWSE_NONE) != NULL) && (IsDlgButtonChecked (pbdp->hDlg, IDC_BROWSE_NONE)) ) { pbdp->szCell[0] = TEXT('\0'); pbdp->szNamed[0] = TEXT('\0'); } else { GetDlgItemText (hDlg, IDC_BROWSE_CELL, pbdp->szCell, cchNAME); GetDlgItemText (hDlg, IDC_BROWSE_NAMED, pbdp->szNamed, cchRESOURCE); } EndDialog (hDlg, IDOK); break; case IDC_BROWSE_CELL: if (HIWORD(wp) == CBN_SELCHANGE) { GetDlgItemText (hDlg, IDC_BROWSE_CELL, pbdp->szCell, cchNAME); DlgProc_Browse_StartSearch (pbdp, FALSE); } break; case IDC_BROWSE_RESTART: GetDlgItemText (hDlg, IDC_BROWSE_CELL, pbdp->szCell, cchNAME); DlgProc_Browse_StartSearch (pbdp, FALSE); PostMessage (hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem (hDlg, IDC_BROWSE_NAMED), (LPARAM)TRUE); break; case IDC_BROWSE_NAMED: if (HIWORD(wp) == EN_UPDATE) // has the user hit Enter here? { TCHAR szTest[ cchRESOURCE ]; GetDlgItemText (hDlg, IDC_BROWSE_NAMED, szTest, cchRESOURCE); if ( (lstrlen (szTest) > 0) && (szTest[ lstrlen(szTest)-1 ] == TEXT('\n')) ) { szTest[ lstrlen(szTest)-1 ] = TEXT('\0'); if ( (lstrlen (szTest) > 0) && (szTest[ lstrlen(szTest)-1 ] == TEXT('\r')) ) { szTest[ lstrlen(szTest)-1 ] = TEXT('\0'); } SetDlgItemText (hDlg, IDC_BROWSE_NAMED, szTest); PostMessage (hDlg, WM_COMMAND, MAKELONG(IDC_BROWSE_SELECT,BN_CLICKED), (LPARAM)GetDlgItem(hDlg,IDC_BROWSE_SELECT)); } } break; case IDC_BROWSE_NONE: DlgProc_Browse_OnNone (hDlg, pbdp); break; } break; } } return FALSE; }
BOOL CALLBACK Subsets_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { if (AfsAppLib_HandleHelp (IDD_SUBSETS, hDlg, msg, wp, lp)) return TRUE; if (msg == WM_INITDIALOG) SetWindowLongPtr (hDlg, DWLP_USER, ((LPPROPSHEETPAGE)lp)->lParam); LPSUBSET sub = (LPSUBSET)GetWindowLongPtr (hDlg, DWLP_USER); switch (msg) { case WM_INITDIALOG_SHEET: PropCache_Add (pcGENERAL, NULL, hDlg); break; case WM_DESTROY_SHEET: PropCache_Delete (hDlg); break; case WM_INITDIALOG: Subsets_OnInitDialog (hDlg, sub); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDAPPLY: Subsets_OnApply (hDlg, sub); break; case IDOK: case IDCANCEL: EndDialog (hDlg, LOWORD(wp)); break; case IDC_SUBSET_LOAD: LPSUBSET subNew; subNew = Subsets_OnLoad (hDlg, sub); if (subNew != NULL) { if (sub) Subsets_FreeSubset (sub); SetWindowLongPtr (hDlg, DWLP_USER, (LONG_PTR)subNew); } break; case IDC_SUBSET_LIST: if (HIWORD(wp) == LBN_CLICKED) // checked or unchecked? { int iSel = LB_GetSelected (GetDlgItem (hDlg, IDC_SUBSET_LIST)); subNew = Subsets_OnCheck (hDlg, iSel, sub); if (subNew && (subNew != sub)) { if (sub) Subsets_FreeSubset (sub); SetWindowLongPtr (hDlg, DWLP_USER, (LONG_PTR)subNew); } } break; case IDC_SUBSET_SAVE: Subsets_OnSave (hDlg, sub); break; case IDC_SUBSET_ALL: case IDC_SUBSET_NONE: subNew = Subsets_OnCheckAll (hDlg, sub, (LOWORD(wp) == IDC_SUBSET_ALL) ? TRUE : FALSE); if (subNew && (subNew != sub)) { if (sub) Subsets_FreeSubset (sub); SetWindowLongPtr (hDlg, DWLP_USER, (LONG_PTR)subNew); } break; } break; } return FALSE; }