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.

167 lines
5.0 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. virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  57. // This mechanism deletes the CAutoDeletePropPage object
  58. // when the wizard is finished
  59. struct
  60. {
  61. INT cWizPages; // Number of pages in wizard
  62. LPFNPSPCALLBACK pfnOriginalPropSheetPageProc;
  63. } m_autodeleteStuff;
  64. static UINT CALLBACK S_PropSheetPageProc(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp);
  65. protected:
  66. CString m_strCaption; // Covers for MFC4.2's missing support for Wiz97.
  67. // without this override, CPropertyPage::m_strCaption
  68. // address is miscalculated and GPF ensues.
  69. CString m_strHelpFile; // Name for the .hlp file
  70. const DWORD * m_prgzHelpIDs; // Optional: Pointer to an array of help IDs
  71. public:
  72. /////////////////////////////////////////////////////////////////////
  73. void SetCaption(UINT uStringID);
  74. void SetCaption(LPCTSTR pszCaption);
  75. void SetHelp(LPCTSTR szHelpFile, const DWORD rgzHelpIDs[]);
  76. void EnableDlgItem(INT nIdDlgItem, BOOL fEnable);
  77. }; // CAutoDeletePropPage
  78. /////////////////////////////////////////////////////////////////////
  79. /////////////////////////////////////////////////////////////////////
  80. // class CChooseMachinePropPage
  81. //
  82. // This object is a stand-alone property page used to
  83. // select a computer name.
  84. //
  85. // The object CChooseMachinePropPage can have its dialog
  86. // template replaced to allow a new wizard without any new code.
  87. // The object can also be inherited, allowing easy extentionability.
  88. //
  89. // RESTRICTIONS:
  90. // If the user wishes to provide its own dialog template, here
  91. // are the dialog IDs that must present:
  92. // IDC_CHOOSER_RADIO_LOCAL_MACHINE - Select local machine.
  93. // IDC_CHOOSER_RADIO_SPECIFIC_MACHINE - Select a specific machine.
  94. // IDC_CHOOSER_EDIT_MACHINE_NAME - Edit field to enter the machine name.
  95. // There are also optional IDs:
  96. // IDC_CHOOSER_BUTTON_BROWSE_MACHINENAMES - Browse to select a machine name.
  97. // IDC_CHOOSER_CHECK_OVERRIDE_MACHINE_NAME - Checkbox to allow the machine name to be overriden by command line.
  98. //
  99. class CChooseMachinePropPage : public CAutoDeletePropPage
  100. {
  101. public:
  102. enum { IID_DEFAULT = IDD_CHOOSER_CHOOSE_MACHINE };
  103. public:
  104. // Construction
  105. CChooseMachinePropPage(UINT uIDD = IID_DEFAULT);
  106. virtual ~CChooseMachinePropPage();
  107. protected:
  108. void InitChooserControls();
  109. // MFC replacements
  110. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  111. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  112. // Dialog Data
  113. BOOL m_fIsRadioLocalMachine;
  114. BOOL m_fEnableMachineBrowse;
  115. CString m_strMachineName;
  116. DWORD* m_pdwFlags;
  117. // Overrides
  118. public:
  119. virtual BOOL OnWizardFinish();
  120. protected:
  121. // Implementation
  122. protected:
  123. virtual BOOL OnInitDialog();
  124. void OnRadioLocalMachine();
  125. void OnRadioSpecificMachine();
  126. void OnBrowse();
  127. protected:
  128. CString * m_pstrMachineNameOut; // OUT: Pointer to the CString object to store the machine name
  129. CString * m_pstrMachineNameEffectiveOut; // OUT: Pointer to the CString object to store the effective machine name
  130. public:
  131. void InitMachineName(LPCTSTR pszMachineName);
  132. void SetOutputBuffers(
  133. OUT CString * pstrMachineNamePersist,
  134. OUT OPTIONAL CString * pstrMachineNameEffective,
  135. OUT DWORD* m_pdwFlags);
  136. }; // CChooseMachinePropPage
  137. #endif // ~__CHOOSER_H_INCLUDED__