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.

171 lines
5.4 KiB

  1. /////////////////////////////////////////////////////////////////////
  2. // Chooser.h
  3. //
  4. // Copyright (c) 1997-1999 Microsoft Corporation
  5. //
  6. // HISTORY
  7. // 13-May-1997 t-danm Creation.
  8. //
  9. /////////////////////////////////////////////////////////////////////
  10. #ifndef __CHOOSER_H_INCLUDED__
  11. #define __CHOOSER_H_INCLUDED__
  12. LPCTSTR PchGetMachineNameOverride();
  13. #include <afxdlgs.h>
  14. #include <mmc.h>
  15. #include "choosert.h" // Temporary IDs
  16. #include "chooserd.h" // Default IDs
  17. /////////////////////////////////////////////////////////////////////
  18. /////////////////////////////////////////////////////////////////////
  19. // class CAutoDeletePropPage
  20. //
  21. // This object is the backbone for property page
  22. // that will *destroy* itself when no longer needed.
  23. // The purpose of this object is to maximize code reuse
  24. // among the various pages in the snapin wizards.
  25. //
  26. // INHERITANCE TREE (so far)
  27. // CAutoDeletePropPage - Base object
  28. // CChooseMachinePropPage - Dialog to select a machine name
  29. // CFileMgmtGeneral - Dialog to select "File Services" (snapin\filemgmt\snapmgr.h)
  30. // CMyComputerGeneral - Dialog for the "My Computer" (snapin\mycomput\snapmgr.h)
  31. // CChoosePrototyperPropPage - Dialog to select prototyper demo (NYI)
  32. //
  33. // HISTORY
  34. // 15-May-1997 t-danm Creation. Split of CChooseMachinePropPage
  35. // to allow property pages to have more flexible dialog
  36. // templates.
  37. //
  38. class CAutoDeletePropPage : public CPropertyPage
  39. {
  40. public:
  41. // Construction
  42. CAutoDeletePropPage(UINT uIDD);
  43. virtual ~CAutoDeletePropPage();
  44. protected:
  45. // Dialog Data
  46. //{{AFX_DATA(CAutoDeletePropPage)
  47. //}}AFX_DATA
  48. // Overrides
  49. // ClassWizard generate virtual function overrides
  50. //{{AFX_VIRTUAL(CAutoDeletePropPage)
  51. virtual BOOL OnSetActive();
  52. //}}AFX_VIRTUAL
  53. // Implementation
  54. protected:
  55. // Generated message map functions
  56. //{{AFX_MSG(CAutoDeletePropPage)
  57. afx_msg BOOL OnHelp(WPARAM wParam, LPARAM lParam);
  58. afx_msg BOOL OnContextHelp(WPARAM wParam, LPARAM lParam);
  59. //}}AFX_MSG
  60. DECLARE_MESSAGE_MAP()
  61. // This mechanism deletes the CAutoDeletePropPage object
  62. // when the wizard is finished
  63. struct
  64. {
  65. INT cWizPages; // Number of pages in wizard
  66. LPFNPSPCALLBACK pfnOriginalPropSheetPageProc;
  67. } m_autodeleteStuff;
  68. static UINT CALLBACK S_PropSheetPageProc(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp);
  69. protected:
  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 InitRadioButtons();
  110. // Dialog Data
  111. //{{AFX_DATA(CChooseMachinePropPage)
  112. BOOL m_fIsRadioLocalMachine; // TRUE => Local Machine is selected
  113. BOOL m_fAllowOverrideMachineName; // TRUE => Machine name can be overriden from command line
  114. CString m_strMachineName;
  115. //}}AFX_DATA
  116. // Overrides
  117. // ClassWizard generate virtual function overrides
  118. //{{AFX_VIRTUAL(CChooseMachinePropPage)
  119. public:
  120. virtual BOOL OnWizardFinish();
  121. protected:
  122. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  123. //}}AFX_VIRTUAL
  124. // Implementation
  125. protected:
  126. // Generated message map functions
  127. //{{AFX_MSG(CChooseMachinePropPage)
  128. virtual BOOL OnInitDialog();
  129. afx_msg void OnRadioLocalMachine();
  130. afx_msg void OnRadioSpecificMachine();
  131. //}}AFX_MSG
  132. DECLARE_MESSAGE_MAP()
  133. HWND m_hwndCheckboxOverride;
  134. protected:
  135. BOOL * m_pfAllowOverrideMachineNameOut; // OUT: Pointer to BOOL receiving flag wherever to override machine name
  136. CString * m_pstrMachineNameOut; // OUT: Pointer to the CString object to store the machine name
  137. CString * m_pstrMachineNameEffectiveOut; // OUT: Pointer to the CString object to store the effective machine name
  138. LONG_PTR m_hNotify; // Notify handle.
  139. public:
  140. void InitMachineName(LPCTSTR pszMachineName);
  141. void SetOutputBuffers(
  142. OUT CString * pstrMachineNamePersist,
  143. OUT OPTIONAL BOOL * pfAllowOverrideMachineName,
  144. OUT OPTIONAL CString * pstrMachineNameEffective);
  145. void SetHandle(LONG_PTR hNotify) { m_hNotify = (LONG_PTR)hNotify; }
  146. }; // CChooseMachinePropPage
  147. #endif // ~__CHOOSER_H_INCLUDED__