Leaked source code of windows server 2003
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.

168 lines
5.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: chooser.h
  8. //
  9. //--------------------------------------------------------------------------
  10. /////////////////////////////////////////////////////////////////////
  11. // Chooser.h
  12. //
  13. // HISTORY
  14. // 13-May-1997 t-danm Creation.
  15. //
  16. /////////////////////////////////////////////////////////////////////
  17. #ifndef __CHOOSER_H_INCLUDED__
  18. #define __CHOOSER_H_INCLUDED__
  19. #include "tfcprop.h"
  20. LPCTSTR PchGetMachineNameOverride();
  21. /////////////////////////////////////////////////////////////////////
  22. /////////////////////////////////////////////////////////////////////
  23. // class CAutoDeletePropPage
  24. //
  25. // This object is the backbone for property page
  26. // that will *destroy* itself when no longer needed.
  27. // The purpose of this object is to maximize code reuse
  28. // among the various pages in the snapin wizards.
  29. //
  30. // INHERITANCE TREE (so far)
  31. // CAutoDeletePropPage - Base object
  32. // CChooseMachinePropPage - Dialog to select a machine name
  33. // CFileMgmtGeneral - Dialog to select "File Services" (snapin\filemgmt\snapmgr.h)
  34. // CMyComputerGeneral - Dialog for the "My Computer" (snapin\mycomput\snapmgr.h)
  35. // CChoosePrototyperPropPage - Dialog to select prototyper demo (NYI)
  36. //
  37. // HISTORY
  38. // 15-May-1997 t-danm Creation. Split of CChooseMachinePropPage
  39. // to allow property pages to have more flexible dialog
  40. // templates.
  41. //
  42. class CAutoDeletePropPage : public PropertyPage
  43. {
  44. public:
  45. // Construction
  46. CAutoDeletePropPage(UINT uIDD);
  47. virtual ~CAutoDeletePropPage();
  48. protected:
  49. // Dialog Data
  50. // Overrides
  51. virtual BOOL OnSetActive();
  52. // Implementation
  53. protected:
  54. void OnHelp(LPHELPINFO lpHelp);
  55. void OnContextHelp(HWND hwnd);
  56. bool HasContextHelp(int nDlgItem);
  57. virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  58. // This mechanism deletes the CAutoDeletePropPage object
  59. // when the wizard is finished
  60. struct
  61. {
  62. INT cWizPages; // Number of pages in wizard
  63. LPFNPSPCALLBACK pfnOriginalPropSheetPageProc;
  64. } m_autodeleteStuff;
  65. static UINT CALLBACK S_PropSheetPageProc(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp);
  66. protected:
  67. CString m_strCaption; // Covers for MFC4.2's missing support for Wiz97.
  68. // without this override, CPropertyPage::m_strCaption
  69. // address is miscalculated and GPF ensues.
  70. CString m_strHelpFile; // Name for the .hlp file
  71. const DWORD * m_prgzHelpIDs; // Optional: Pointer to an array of help IDs
  72. public:
  73. /////////////////////////////////////////////////////////////////////
  74. void SetCaption(UINT uStringID);
  75. void SetCaption(LPCTSTR pszCaption);
  76. void SetHelp(LPCTSTR szHelpFile, const DWORD rgzHelpIDs[]);
  77. void EnableDlgItem(INT nIdDlgItem, BOOL fEnable);
  78. }; // CAutoDeletePropPage
  79. /////////////////////////////////////////////////////////////////////
  80. /////////////////////////////////////////////////////////////////////
  81. // class CChooseMachinePropPage
  82. //
  83. // This object is a stand-alone property page used to
  84. // select a computer name.
  85. //
  86. // The object CChooseMachinePropPage can have its dialog
  87. // template replaced to allow a new wizard without any new code.
  88. // The object can also be inherited, allowing easy extentionability.
  89. //
  90. // RESTRICTIONS:
  91. // If the user wishes to provide its own dialog template, here
  92. // are the dialog IDs that must present:
  93. // IDC_CHOOSER_RADIO_LOCAL_MACHINE - Select local machine.
  94. // IDC_CHOOSER_RADIO_SPECIFIC_MACHINE - Select a specific machine.
  95. // IDC_CHOOSER_EDIT_MACHINE_NAME - Edit field to enter the machine name.
  96. // There are also optional IDs:
  97. // IDC_CHOOSER_BUTTON_BROWSE_MACHINENAMES - Browse to select a machine name.
  98. // IDC_CHOOSER_CHECK_OVERRIDE_MACHINE_NAME - Checkbox to allow the machine name to be overriden by command line.
  99. //
  100. class CChooseMachinePropPage : public CAutoDeletePropPage
  101. {
  102. public:
  103. enum { IID_DEFAULT = IDD_CHOOSER_CHOOSE_MACHINE };
  104. public:
  105. // Construction
  106. CChooseMachinePropPage(UINT uIDD = IID_DEFAULT);
  107. virtual ~CChooseMachinePropPage();
  108. protected:
  109. void InitChooserControls();
  110. // MFC replacements
  111. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  112. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  113. // Dialog Data
  114. BOOL m_fIsRadioLocalMachine;
  115. BOOL m_fEnableMachineBrowse;
  116. CString m_strMachineName;
  117. DWORD* m_pdwFlags;
  118. // Overrides
  119. public:
  120. virtual BOOL OnWizardFinish();
  121. protected:
  122. // Implementation
  123. protected:
  124. virtual BOOL OnInitDialog();
  125. void OnRadioLocalMachine();
  126. void OnRadioSpecificMachine();
  127. void OnBrowse();
  128. protected:
  129. CString * m_pstrMachineNameOut; // OUT: Pointer to the CString object to store the machine name
  130. CString * m_pstrMachineNameEffectiveOut; // OUT: Pointer to the CString object to store the effective machine name
  131. public:
  132. void InitMachineName(LPCTSTR pszMachineName);
  133. void SetOutputBuffers(
  134. OUT CString * pstrMachineNamePersist,
  135. OUT OPTIONAL CString * pstrMachineNameEffective,
  136. OUT DWORD* m_pdwFlags);
  137. }; // CChooseMachinePropPage
  138. #endif // ~__CHOOSER_H_INCLUDED__