Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

534 lines
12 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // DS Administration MMC snapin.
  4. //
  5. // Microsoft Windows
  6. // Copyright (C) Microsoft Corporation, 1992 - 1999
  7. //
  8. // File: DSDlgs.h
  9. //
  10. // Contents: Definition for the DS Dialogs
  11. //
  12. // History: 03-Oct-96 WayneSc Created
  13. //
  14. //-----------------------------------------------------------------------------
  15. #ifndef __DSDLGS_H__
  16. #define __DSDLGS_H__
  17. #include "dcbufmgr.h"
  18. #include "uiutil.h"
  19. HRESULT GetDnsNameOfDomainOrForest(
  20. IN CString& csName,
  21. OUT CString& csDnsName,
  22. IN BOOL bIsInputADomainName,
  23. IN BOOL bRequireDomain
  24. );
  25. //+----------------------------------------------------------------------------
  26. //
  27. // Class: CPropDlg
  28. //
  29. // Purpose: Display the properties of a DS object.
  30. //
  31. //-----------------------------------------------------------------------------
  32. class CPropDlg
  33. {
  34. public:
  35. CPropDlg() {}
  36. ~CPropDlg() {}
  37. void SetTitle(CString* pstrTitle) {m_strTitle = *pstrTitle;}
  38. void SetTitle(LPTSTR szTitle) {m_strTitle = szTitle;}
  39. CString GetTitle(void) {return m_strTitle;}
  40. void SetUrl(CString* pstrUrl) {m_strUrl = *pstrUrl;}
  41. void SetUrl(LPTSTR szUrl) {m_strUrl = szUrl;}
  42. CString GetUrl(void) {return m_strUrl;}
  43. void DoModal(void) {CString strMsg = _T("The Url is ");
  44. strMsg += m_strUrl;
  45. MessageBox(NULL, strMsg, m_strTitle, MB_OK);}
  46. private:
  47. CString m_strTitle;
  48. CString m_strUrl;
  49. }; // CPropDlg
  50. /////////////////////////////////////////////////////////////////////////////
  51. class CChangePassword : public CHelpDialog
  52. {
  53. // Construction
  54. public:
  55. CChangePassword(CWnd* pParent = NULL); // standard constructor
  56. CString GetConfirm () { return m_ConfirmPwd;};
  57. CString GetNew () { return m_NewPwd;};
  58. BOOL GetChangePwd() { return m_ChangePwd; };
  59. void Clear();
  60. void AllowMustChangePasswordCheck(BOOL bAllowCheck) { m_bAllowMustChangePwdCheck = bAllowCheck; }
  61. // Dialog Data
  62. //{{AFX_DATA(CChangePassword)
  63. enum { IDD = IDD_CHANGE_PASSWORD };
  64. CString m_ConfirmPwd;
  65. CString m_NewPwd;
  66. BOOL m_ChangePwd;
  67. //}}AFX_DATA
  68. public:
  69. virtual BOOL OnInitDialog();
  70. virtual void DoContextHelp(HWND hWndControl);
  71. // Overrides
  72. // ClassWizard generated virtual function overrides
  73. //{{AFX_VIRTUAL(CChangePassword)
  74. protected:
  75. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  76. //}}AFX_VIRTUAL
  77. // Implementation
  78. protected:
  79. // Generated message map functions
  80. //{{AFX_MSG(CChangePassword)
  81. //}}AFX_MSG
  82. DECLARE_MESSAGE_MAP()
  83. private:
  84. BOOL m_bAllowMustChangePwdCheck;
  85. }; // CChangePassword
  86. /////////////////////////////////////////////////////////////////////////////
  87. // CChooseDomainDlg dialog
  88. class CChooseDomainDlg : public CHelpDialog
  89. {
  90. // Construction
  91. public:
  92. CChooseDomainDlg(CWnd* pParent = NULL); // standard constructor
  93. // Dialog Data
  94. //{{AFX_DATA(CChooseDomainDlg)
  95. enum { IDD = IDD_SELECT_DOMAIN };
  96. CString m_csTargetDomain;
  97. BOOL m_bSaveCurrent;
  98. //}}AFX_DATA
  99. BOOL m_bSiteRepl;
  100. virtual void DoContextHelp(HWND hWndControl);
  101. // Overrides
  102. // ClassWizard generated virtual function overrides
  103. //{{AFX_VIRTUAL(CChooseDomainDlg)
  104. protected:
  105. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  106. //}}AFX_VIRTUAL
  107. // Implementation
  108. protected:
  109. // Generated message map functions
  110. //{{AFX_MSG(CChooseDomainDlg)
  111. afx_msg void OnSelectdomainBrowse();
  112. virtual void OnOK();
  113. virtual BOOL OnInitDialog();
  114. //}}AFX_MSG
  115. DECLARE_MESSAGE_MAP()
  116. };
  117. /////////////////////////////////////////////////////////////////////////////
  118. // CChooseDCDlg dialog
  119. class CSelectDCEdit : public CEdit
  120. {
  121. public:
  122. BOOL m_bHandleKillFocus;
  123. inline CSelectDCEdit() { m_bHandleKillFocus = FALSE; }
  124. afx_msg void OnKillFocus(CWnd* pNewWnd);
  125. DECLARE_MESSAGE_MAP()
  126. };
  127. class CChooseDCDlg : public CHelpDialog
  128. {
  129. // Construction
  130. public:
  131. CChooseDCDlg(CWnd* pParent = NULL); // standard constructor
  132. ~CChooseDCDlg();
  133. // Dialog Data
  134. //{{AFX_DATA(CChooseDCDlg)
  135. enum { IDD = IDD_SELECT_DC };
  136. CListCtrl m_hDCListView;
  137. CString m_csTargetDomainController;
  138. CString m_csTargetDomain;
  139. //}}AFX_DATA
  140. CSelectDCEdit m_selectDCEdit;
  141. BOOL m_bSiteRepl;
  142. CString m_csPrevDomain;
  143. CDCBufferManager *m_pDCBufferManager;
  144. CString m_csAnyDC;
  145. CString m_csWaiting;
  146. CString m_csError;
  147. virtual void DoContextHelp(HWND hWndControl);
  148. // Overrides
  149. // ClassWizard generated virtual function overrides
  150. //{{AFX_VIRTUAL(CChooseDCDlg)
  151. protected:
  152. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  153. //}}AFX_VIRTUAL
  154. // Implementation
  155. protected:
  156. void OnGetDCThreadDone(WPARAM wParam, LPARAM lParam);
  157. void InsertSpecialMsg(
  158. IN BOOL bWaiting
  159. );
  160. HRESULT InsertDCListView(
  161. IN CDCSITEINFO *pEntry
  162. );
  163. void RefreshDCListViewErrorReport(
  164. IN PCTSTR pszDomainName,
  165. IN HRESULT hr
  166. );
  167. void RefreshDCListView();
  168. void FreeDCItems(CListCtrl& clv);
  169. // Generated message map functions
  170. //{{AFX_MSG(CChooseDCDlg)
  171. virtual BOOL OnInitDialog();
  172. afx_msg void OnItemchangedSelectdcDCListView(NMHDR* pNMHDR, LRESULT* pResult);
  173. afx_msg void OnKillfocusSelectdcDomain();
  174. virtual void OnOK();
  175. virtual void OnCancel();
  176. afx_msg void OnSelectdcBrowse();
  177. afx_msg void OnColumnclickSelectdcDCListView(NMHDR* pNMHDR, LRESULT* pResult);
  178. //}}AFX_MSG
  179. DECLARE_MESSAGE_MAP()
  180. };
  181. /////////////////////////////////////////////////////////////////////////
  182. // CDsAdminChooseDCObj
  183. class CDsAdminChooseDCObj:
  184. public IDsAdminChooseDC,
  185. public CComObjectRoot,
  186. public CComCoClass<CDsAdminChooseDCObj, &CLSID_DsAdminChooseDCObj>
  187. {
  188. public:
  189. BEGIN_COM_MAP(CDsAdminChooseDCObj)
  190. COM_INTERFACE_ENTRY(IDsAdminChooseDC)
  191. END_COM_MAP()
  192. DECLARE_REGISTRY_CLSID()
  193. CDsAdminChooseDCObj()
  194. {
  195. }
  196. ~CDsAdminChooseDCObj()
  197. {
  198. }
  199. // IDsAdminChooseDC
  200. STDMETHOD(InvokeDialog)(/*IN*/ HWND hwndParent,
  201. /*IN*/ LPCWSTR lpszTargetDomain,
  202. /*IN*/ LPCWSTR lpszTargetDomainController,
  203. /*IN*/ ULONG uFlags,
  204. /*OUT*/ BSTR* bstrSelectedDC);
  205. };
  206. /////////////////////////////////////////////////////////////////////////////
  207. // CRenameUser dialog
  208. class CRenameUserDlg : public CHelpDialog
  209. {
  210. // Construction
  211. public:
  212. CRenameUserDlg(CDSComponentData* pComponentData, CWnd* pParent = NULL); // standard constructor
  213. // Dialog Data
  214. //{{AFX_DATA(CRenameUserDlg)
  215. enum { IDD = IDD_RENAME_USER };
  216. CString m_cn;
  217. CString m_displayname;
  218. CString m_oldcn;
  219. CString m_login;
  220. CString m_samaccountname;
  221. CString m_domain;
  222. CString m_dldomain;
  223. CStringList m_domains;
  224. CString m_first;
  225. CString m_last;
  226. //}}AFX_DATA
  227. // Overrides
  228. virtual void DoContextHelp(HWND hWndControl);
  229. afx_msg void OnObjectNameChange();
  230. afx_msg void OnNameChange();
  231. afx_msg void OnUserNameChange();
  232. // ClassWizard generated virtual function overrides
  233. //{{AFX_VIRTUAL(CRenameUserDlg)
  234. protected:
  235. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  236. //}}AFX_VIRTUAL
  237. // Implementation
  238. protected:
  239. CUserNameFormatter m_nameFormatter; // name ordering for given name and surname
  240. // Generated message map functions
  241. //{{AFX_MSG(CRenameUserDlg)
  242. virtual BOOL OnInitDialog();
  243. //}}AFX_MSG
  244. DECLARE_MESSAGE_MAP()
  245. private:
  246. CDSComponentData* m_pComponentData;
  247. };
  248. /////////////////////////////////////////////////////////////////////////////
  249. // CRenameGeneric dialog
  250. class CRenameGenericDlg : public CHelpDialog
  251. {
  252. // Construction
  253. public:
  254. CRenameGenericDlg(CWnd* pParent = NULL); // standard constructor
  255. // Dialog Data
  256. //{{AFX_DATA(CRenameGenericDlg)
  257. enum { IDD = IDD_RENAME_GENERIC };
  258. CString m_cn;
  259. //}}AFX_DATA
  260. // Overrides
  261. virtual void DoContextHelp(HWND hWndControl);
  262. // ClassWizard generated virtual function overrides
  263. //{{AFX_VIRTUAL(CRenameGenericDlg)
  264. protected:
  265. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  266. //}}AFX_VIRTUAL
  267. // Implementation
  268. protected:
  269. // Generated message map functions
  270. //{{AFX_MSG(CRenameGenericDlg)
  271. virtual BOOL OnInitDialog();
  272. //}}AFX_MSG
  273. DECLARE_MESSAGE_MAP()
  274. };
  275. /////////////////////////////////////////////////////////////////////////////
  276. // CRenameGroup dialog
  277. class CRenameGroupDlg : public CHelpDialog
  278. {
  279. // Construction
  280. public:
  281. CRenameGroupDlg(CWnd* pParent = NULL); // standard constructor
  282. // Dialog Data
  283. //{{AFX_DATA(CRenameGroupDlg)
  284. enum { IDD = IDD_RENAME_GROUP };
  285. CString m_samaccountname;
  286. CString m_cn;
  287. UINT m_samtextlimit;
  288. //}}AFX_DATA
  289. // Overrides
  290. virtual void DoContextHelp(HWND hWndControl);
  291. // ClassWizard generated virtual function overrides
  292. //{{AFX_VIRTUAL(CRenameGroupDlg)
  293. protected:
  294. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  295. //}}AFX_VIRTUAL
  296. // Implementation
  297. protected:
  298. // Generated message map functions
  299. //{{AFX_MSG(CRenameGroupDlg)
  300. virtual BOOL OnInitDialog();
  301. //}}AFX_MSG
  302. DECLARE_MESSAGE_MAP()
  303. };
  304. /////////////////////////////////////////////////////////////////////////////
  305. // CRenameContact dialog
  306. class CRenameContactDlg : public CHelpDialog
  307. {
  308. // Construction
  309. public:
  310. CRenameContactDlg(CWnd* pParent = NULL); // standard constructor
  311. // Dialog Data
  312. //{{AFX_DATA(CRenameContactDlg)
  313. enum { IDD = IDD_RENAME_CONTACT };
  314. CString m_cn;
  315. CString m_first;
  316. CString m_last;
  317. CString m_disp;
  318. //}}AFX_DATA
  319. // Overrides
  320. virtual void DoContextHelp(HWND hWndControl);
  321. // ClassWizard generated virtual function overrides
  322. //{{AFX_VIRTUAL(CRenameContactDlg)
  323. protected:
  324. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  325. //}}AFX_VIRTUAL
  326. // Implementation
  327. protected:
  328. // Generated message map functions
  329. //{{AFX_MSG(CRenameContactDlg)
  330. virtual BOOL OnInitDialog();
  331. //}}AFX_MSG
  332. DECLARE_MESSAGE_MAP()
  333. };
  334. /////////////////////////////////////////////////////////////////////////////
  335. // CSpecialMessageBox dialog
  336. class CSpecialMessageBox : public CDialog
  337. {
  338. // Construction
  339. public:
  340. CSpecialMessageBox(CWnd* pParent = NULL); // standard constructor
  341. // Dialog Data
  342. //{{AFX_DATA(CSpecialMessageBox)
  343. enum { IDD = IDD_MULTIPLE_ERROR };
  344. CString m_title;
  345. CString m_message;
  346. //}}AFX_DATA
  347. // Overrides
  348. afx_msg void OnHelpInfo(HELPINFO* lpHelpInfo );
  349. // ClassWizard generated virtual function overrides
  350. //{{AFX_VIRTUAL(CSpecialMessageBox)
  351. protected:
  352. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  353. //}}AFX_VIRTUAL
  354. // Implementation
  355. protected:
  356. // Generated message map functions
  357. //{{AFX_MSG(CSpecialMessageBox)
  358. virtual BOOL OnInitDialog();
  359. afx_msg void OnYesButton();
  360. afx_msg void OnNoButton();
  361. afx_msg void OnYesToAllButton();
  362. //}}AFX_MSG
  363. DECLARE_MESSAGE_MAP()
  364. };
  365. #ifdef FIXUPDC
  366. /////////////////////////////////////////////////////////////////////////////
  367. // CFixupDC dialog
  368. #define NUM_FIXUP_OPTIONS 6
  369. typedef struct _FixupOptionsMsg {
  370. DWORD dwOption;
  371. int nMsgID;
  372. BOOL bDefaultOn;
  373. } FixupOptionsMsg;
  374. class CFixupDC : public CHelpDialog
  375. {
  376. // Construction
  377. public:
  378. CFixupDC(CWnd* pParent = NULL); // standard constructor
  379. // Dialog Data
  380. //{{AFX_DATA(CFixupDC)
  381. enum { IDD = IDD_FIXUP_DC };
  382. CString m_strServer;
  383. //}}AFX_DATA
  384. BOOL m_bCheck[NUM_FIXUP_OPTIONS];
  385. // Overrides
  386. virtual void DoContextHelp(HWND hWndControl);
  387. // ClassWizard generated virtual function overrides
  388. //{{AFX_VIRTUAL(CFixupDC)
  389. protected:
  390. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  391. //}}AFX_VIRTUAL
  392. // Implementation
  393. protected:
  394. // Generated message map functions
  395. //{{AFX_MSG(CFixupDC)
  396. virtual BOOL OnInitDialog();
  397. virtual void OnOK();
  398. //}}AFX_MSG
  399. DECLARE_MESSAGE_MAP()
  400. };
  401. #endif // FIXUPDC
  402. /////////////////////////////////////////////////////////////////////////////
  403. // CPasswordDlg dialog
  404. class CPasswordDlg : public CHelpDialog
  405. {
  406. // Construction
  407. public:
  408. CPasswordDlg(CWnd* pParent = NULL); // standard constructor
  409. // Dialog Data
  410. //{{AFX_DATA(CPasswordDlg)
  411. enum { IDD = IDD_PASSWORD };
  412. CString m_strPassword;
  413. CString m_strUserName;
  414. //}}AFX_DATA
  415. // Overrides
  416. virtual void DoContextHelp(HWND hWndControl);
  417. // ClassWizard generated virtual function overrides
  418. //{{AFX_VIRTUAL(CPasswordDlg)
  419. protected:
  420. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  421. //}}AFX_VIRTUAL
  422. // Implementation
  423. protected:
  424. // Generated message map functions
  425. //{{AFX_MSG(CPasswordDlg)
  426. virtual void OnOK();
  427. //}}AFX_MSG
  428. DECLARE_MESSAGE_MAP()
  429. };
  430. #endif //__DSDLGS_H__