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.

261 lines
9.5 KiB

  1. VERSION 5.00
  2. Begin VB.UserControl AboutCtl
  3. BackColor = &H80000005&
  4. ClientHeight = 5730
  5. ClientLeft = 0
  6. ClientTop = 0
  7. ClientWidth = 7350
  8. ScaleHeight = 5730
  9. ScaleWidth = 7350
  10. Begin VB.CommandButton ConfigureButton
  11. BackColor = &H80000005&
  12. Height = 615
  13. Left = 6120
  14. MaskColor = &H00FFFFFF&
  15. Picture = "AboutCtl.ctx":0000
  16. Style = 1 'Graphical
  17. TabIndex = 1
  18. TabStop = 0 'False
  19. ToolTipText = "Run the FileExplorer Configuration Wizard"
  20. Top = 1440
  21. Width = 735
  22. End
  23. Begin VB.Label Label4
  24. BackColor = &H80000005&
  25. Caption = "Configuration"
  26. BeginProperty Font
  27. Name = "Arial"
  28. Size = 8.25
  29. Charset = 0
  30. Weight = 400
  31. Underline = 0 'False
  32. Italic = 0 'False
  33. Strikethrough = 0 'False
  34. EndProperty
  35. Height = 255
  36. Left = 6000
  37. TabIndex = 5
  38. Top = 2160
  39. Width = 975
  40. End
  41. Begin VB.Label Label3
  42. BackColor = &H80000005&
  43. Caption = "Copyright� Microsoft Corporation 1999"
  44. BeginProperty Font
  45. Name = "Arial"
  46. Size = 9.75
  47. Charset = 0
  48. Weight = 400
  49. Underline = 0 'False
  50. Italic = 0 'False
  51. Strikethrough = 0 'False
  52. EndProperty
  53. Height = 375
  54. Left = 240
  55. TabIndex = 4
  56. Top = 3000
  57. Width = 5055
  58. End
  59. Begin VB.Label Label2
  60. BackColor = &H80000005&
  61. Caption = $"AboutCtl.ctx":16F2
  62. BeginProperty Font
  63. Name = "Arial"
  64. Size = 9.75
  65. Charset = 0
  66. Weight = 400
  67. Underline = 0 'False
  68. Italic = 0 'False
  69. Strikethrough = 0 'False
  70. EndProperty
  71. Height = 975
  72. Left = 240
  73. TabIndex = 3
  74. Top = 1560
  75. Width = 5175
  76. WordWrap = -1 'True
  77. End
  78. Begin VB.Label Label1
  79. BackColor = &H80000005&
  80. Caption = "Snap-in Designer for Visual Basic 6.0"
  81. BeginProperty Font
  82. Name = "Arial"
  83. Size = 9.75
  84. Charset = 0
  85. Weight = 700
  86. Underline = 0 'False
  87. Italic = 0 'False
  88. Strikethrough = 0 'False
  89. EndProperty
  90. Height = 255
  91. Left = 240
  92. TabIndex = 2
  93. Top = 960
  94. Width = 5055
  95. End
  96. Begin VB.Line Line1
  97. X1 = 240
  98. X2 = 5280
  99. Y1 = 720
  100. Y2 = 720
  101. End
  102. Begin VB.Label lblAboutText
  103. BackColor = &H80000005&
  104. Caption = "About FileExplorer"
  105. BeginProperty Font
  106. Name = "Arial"
  107. Size = 14.25
  108. Charset = 0
  109. Weight = 400
  110. Underline = 0 'False
  111. Italic = 0 'False
  112. Strikethrough = 0 'False
  113. EndProperty
  114. Height = 375
  115. Left = 308
  116. TabIndex = 0
  117. Top = 120
  118. Width = 6735
  119. End
  120. End
  121. Attribute VB_Name = "AboutCtl"
  122. Attribute VB_GlobalNameSpace = False
  123. Attribute VB_Creatable = True
  124. Attribute VB_PredeclaredId = False
  125. Attribute VB_Exposed = True
  126. ' ===========================================================================
  127. ' | THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF |
  128. ' | ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO |
  129. ' | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A |
  130. ' | PARTICULAR PURPOSE. |
  131. ' | Copyright (c) 1998-1999 Microsoft Corporation |
  132. ' ===========================================================================
  133. ' =============================================================================
  134. ' File: AboutCtl.ctl
  135. ' Project: FileExplorerSample
  136. ' Type: User Control
  137. ' =============================================================================
  138. Option Explicit
  139. ' Property Sheet provider object is stored here. If the user hits the "Configuration"
  140. ' button we'll use it to display the configuration wizard
  141. Private m_PropertySheetProvider As MMCPropertySheetProvider
  142. ' Root ScopeItem used for the configuration wizard is stored here
  143. Private m_RootScopeItem As ScopeItem
  144. ' Error message strings
  145. Const SZ_ERRTITLE = "FileExplorer Runtime Error"
  146. ' =============================================================================
  147. ' Method: AboutText
  148. ' Type: Property Let
  149. ' Description: Sets the current value of the AboutText property
  150. '
  151. ' Parameters: Text New value for AboutText
  152. ' Output: None
  153. ' Notes: Sets about text label's caption to this property
  154. ' =============================================================================
  155. '
  156. Public Property Let AboutText(ByVal Text As String)
  157. lblAboutText.Caption = Text
  158. End Property
  159. ' =============================================================================
  160. ' Method: PropertySheetProvider
  161. ' Type: Property Let
  162. ' Description: Sets the current value of the PropertySheetProvider property
  163. '
  164. ' Parameters: Provider New value for PropertySheetProvider
  165. ' Output: None
  166. ' Notes: Stores MMCPropertySheetProvider object to be used if user hits
  167. ' "Configuration" button
  168. ' =============================================================================
  169. '
  170. Public Property Let PropertySheetProvider(ByVal Provider As MMCPropertySheetProvider)
  171. Set m_PropertySheetProvider = Provider
  172. End Property
  173. ' =============================================================================
  174. ' Method: RootScopeItem
  175. ' Type: Property Let
  176. ' Description: Sets the current value of the RootScopeItem property
  177. '
  178. ' Parameters: RootScopeItem New value for RootScopeItem
  179. ' Output: None
  180. ' Notes: Stores ScopeItem to be used if user hits "Configuration" button
  181. ' =============================================================================
  182. '
  183. Public Property Let RootScopeItem(ByVal RootScopeItem As ScopeItem)
  184. Set m_RootScopeItem = RootScopeItem
  185. End Property
  186. ' =============================================================================
  187. ' Method: ConfigureButton_Click
  188. ' Type: Event handler
  189. ' Description: Called when the user hits "Configuration" button
  190. '
  191. ' Parameters: None
  192. ' Output: None
  193. ' Notes: Uses the stored MMCPropertySheetProvider to display the
  194. ' configuration wizard. This code is the same as is done by
  195. ' the snap-in when the user clicks the "Configuration" item on the
  196. ' "Explorer" menu button drop-down. It is repeated here to show how
  197. ' MMCPropertySheetProvider can be used from within an OCX view.
  198. ' =============================================================================
  199. '
  200. Private Sub ConfigureButton_Click()
  201. On Error GoTo ErrTrap_ConfigureButton_Click
  202. With m_PropertySheetProvider
  203. ' Create the property sheet as a wizard.
  204. .CreatePropertySheet "FileExplorer Configuration Wizard", siWizard, m_RootScopeItem
  205. ' Tell MMC to add the pages for the primary snap-in. This will fire
  206. ' Views_QueryPagesFor and Views_CreatePropertyPages
  207. .AddPrimaryPages True
  208. ' Tell MMC to show the property sheet starting with the 1st page
  209. .Show 1
  210. End With
  211. Exit Sub
  212. ' Error Handler for this method
  213. ErrTrap_ConfigureButton_Click:
  214. DisplayError "ConfigureButton_Click"
  215. End Sub
  216. ' =============================================================================
  217. ' Method: DisplayError
  218. ' Type: Subroutine
  219. ' Description: A method to format and display a runtime error
  220. ' Parameters: szLocation A string identifying the source location
  221. ' (i.e. method name) where the error occurred
  222. ' Output: None
  223. ' Notes: The error will be displayed in a messagebox formatted as the
  224. ' following sample:
  225. '
  226. ' Method: SomeMethodName
  227. ' Source: MMCListSubItems
  228. ' Error: 2527h (9511)
  229. ' Description: There is already an item in the collection that has the specified key
  230. '
  231. ' =============================================================================
  232. '
  233. Private Sub DisplayError(szLocation As String)
  234. MsgBox "Method:" & vbTab & vbTab & szLocation & vbCrLf _
  235. & "Source:" & vbTab & vbTab & Err.Source & vbCrLf _
  236. & "Error:" & vbTab & vbTab & Hex(Err.Number) & "h (" & CStr(Err.Number) & ")" & vbCrLf _
  237. & "Description:" & vbTab & Err.Description, _
  238. vbCritical, SZ_ERRTITLE
  239. End Sub