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.

215 lines
4.9 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1994 - 1996.
  5. //
  6. // File: seltrig.hxx
  7. //
  8. // Contents: Task wizard trigger selection property page.
  9. //
  10. // Classes: CSelectTriggerPage
  11. //
  12. // History: 4-30-1997 DavidMun Created
  13. //
  14. //---------------------------------------------------------------------------
  15. #ifndef __SELTRIG_HXX_
  16. #define __SELTRIG_HXX_
  17. //+--------------------------------------------------------------------------
  18. //
  19. // Class: CSelectTriggerPage
  20. //
  21. // Purpose: Implement the task wizard trigger selection dialog
  22. //
  23. // History: 4-28-1997 DavidMun Created
  24. //
  25. //---------------------------------------------------------------------------
  26. class CSelectTriggerPage: public CWizPage
  27. {
  28. public:
  29. CSelectTriggerPage::CSelectTriggerPage(
  30. CTaskWizard *pParent,
  31. LPTSTR ptszFolderPath,
  32. HPROPSHEETPAGE *phPSP);
  33. CSelectTriggerPage::~CSelectTriggerPage();
  34. //
  35. // CPropPage overrides
  36. //
  37. virtual LRESULT
  38. _OnCommand(
  39. INT id,
  40. HWND hwndCtl,
  41. UINT codeNotify);
  42. //
  43. // CWizPage overrides
  44. //
  45. virtual LRESULT
  46. _OnInitDialog(
  47. LPARAM lParam);
  48. virtual LRESULT
  49. _OnPSNSetActive(
  50. LPARAM lParam);
  51. virtual LRESULT
  52. _OnWizBack();
  53. virtual LRESULT
  54. _OnWizNext();
  55. //
  56. // New methods
  57. //
  58. ULONG
  59. GetSelectedTriggerPageID();
  60. ULONG
  61. GetSelectedTriggerType();
  62. CTriggerPage *
  63. GetSelectedTriggerPage();
  64. LPCTSTR
  65. GetTaskName();
  66. LPCTSTR
  67. GetJobObjectFullPath();
  68. private:
  69. CTaskWizard *_pParent;
  70. ULONG _idSelectedTrigger;
  71. TCHAR _tszDisplayName[MAX_PATH + 1];
  72. TCHAR _tszJobObjectFullPath[MAX_PATH + 1];
  73. };
  74. //+--------------------------------------------------------------------------
  75. //
  76. // Member: CSelectTriggerPage::GetSelectedTriggerPageID
  77. //
  78. // Synopsis: Return the resource id of the trigger page the user selected
  79. //
  80. // Returns: IDD_*
  81. //
  82. // History: 5-06-1997 DavidMun Created
  83. //
  84. //---------------------------------------------------------------------------
  85. inline ULONG
  86. CSelectTriggerPage::GetSelectedTriggerPageID()
  87. {
  88. if (_idSelectedTrigger == seltrig_startup_rb ||
  89. _idSelectedTrigger == seltrig_logon_rb)
  90. {
  91. return IDD_SELECT_TRIGGER;
  92. }
  93. return IDD_DAILY + (_idSelectedTrigger - seltrig_first_rb);
  94. }
  95. //+--------------------------------------------------------------------------
  96. //
  97. // Member: CSelectTriggerPage::GetSelectedTriggerType
  98. //
  99. // Synopsis: Return the resource id of the selected trigger radio button
  100. //
  101. // History: 5-20-1997 DavidMun Created
  102. //
  103. //---------------------------------------------------------------------------
  104. inline ULONG
  105. CSelectTriggerPage::GetSelectedTriggerType()
  106. {
  107. return _idSelectedTrigger;
  108. }
  109. //+--------------------------------------------------------------------------
  110. //
  111. // Member: CSelectTriggerPage::GetSelectedTriggerPage
  112. //
  113. // Synopsis: Return a pointer to the wizard page corresponding to the
  114. // selected trigger radio button, or NULL if there is no such
  115. // page or a radio button hasn't been selected yet.
  116. //
  117. // History: 5-20-1997 DavidMun Created
  118. //
  119. //---------------------------------------------------------------------------
  120. inline CTriggerPage *
  121. CSelectTriggerPage::GetSelectedTriggerPage()
  122. {
  123. if (!_idSelectedTrigger ||
  124. _idSelectedTrigger == seltrig_startup_rb ||
  125. _idSelectedTrigger == seltrig_logon_rb)
  126. {
  127. return NULL;
  128. }
  129. TASK_WIZARD_PAGE twp;
  130. twp = (TASK_WIZARD_PAGE)
  131. ((ULONG)TWP_DAILY + (_idSelectedTrigger - seltrig_first_rb));
  132. return (CTriggerPage *)_pParent->GetPage(twp);
  133. }
  134. //+--------------------------------------------------------------------------
  135. //
  136. // Member: CSelectTriggerPage::GetTaskName
  137. //
  138. // Synopsis: Return the task display name, which is used as the filename
  139. // of the .job object path returned by GetJobObjectFullPath.
  140. //
  141. // History: 5-06-1997 DavidMun Created
  142. //
  143. //---------------------------------------------------------------------------
  144. inline LPCTSTR
  145. CSelectTriggerPage::GetTaskName()
  146. {
  147. return _tszDisplayName;
  148. }
  149. //+--------------------------------------------------------------------------
  150. //
  151. // Member: CSelectTriggerPage::GetJobObjectFullPath
  152. //
  153. // Synopsis: Return the full path to the .job object
  154. //
  155. // History: 5-19-1997 DavidMun Created
  156. //
  157. //---------------------------------------------------------------------------
  158. inline LPCTSTR
  159. CSelectTriggerPage::GetJobObjectFullPath()
  160. {
  161. return _tszJobObjectFullPath;
  162. }
  163. #endif // __SELTRIG_HXX_