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.

440 lines
15 KiB

  1. VERSION 5.00
  2. Begin VB.PropertyPage ppgGeneral
  3. Caption = "General"
  4. ClientHeight = 5040
  5. ClientLeft = 0
  6. ClientTop = 0
  7. ClientWidth = 4650
  8. PaletteMode = 0 'Halftone
  9. ScaleHeight = 5040
  10. ScaleWidth = 4650
  11. Begin VB.CheckBox optAttributes
  12. Caption = "&Read-only"
  13. Enabled = 0 'False
  14. Height = 195
  15. Index = 0
  16. Left = 1710
  17. TabIndex = 4
  18. Top = 4110
  19. Width = 1095
  20. End
  21. Begin VB.CheckBox optAttributes
  22. Caption = "Ar&chive"
  23. Enabled = 0 'False
  24. Height = 195
  25. Index = 1
  26. Left = 1710
  27. TabIndex = 3
  28. Top = 4380
  29. Width = 1095
  30. End
  31. Begin VB.CheckBox optAttributes
  32. Caption = "Co&mpress"
  33. Enabled = 0 'False
  34. Height = 195
  35. Index = 2
  36. Left = 1710
  37. TabIndex = 2
  38. Top = 4650
  39. Width = 1095
  40. End
  41. Begin VB.CheckBox optAttributes
  42. Caption = "Hi&dden"
  43. Enabled = 0 'False
  44. Height = 195
  45. Index = 3
  46. Left = 3240
  47. TabIndex = 1
  48. Top = 4110
  49. Width = 1095
  50. End
  51. Begin VB.CheckBox optAttributes
  52. Caption = "System"
  53. Enabled = 0 'False
  54. Height = 195
  55. Index = 4
  56. Left = 3240
  57. TabIndex = 0
  58. Top = 4380
  59. Width = 1095
  60. End
  61. Begin VB.Label lblLocation
  62. Caption = "lblLocation"
  63. Height = 255
  64. Left = 1695
  65. TabIndex = 20
  66. Top = 1665
  67. Width = 3750
  68. End
  69. Begin VB.Image imgDisplay
  70. Height = 735
  71. Left = 360
  72. Top = 240
  73. Width = 735
  74. End
  75. Begin VB.Line Line1
  76. BorderColor = &H80000010&
  77. Index = 0
  78. X1 = 240
  79. X2 = 5880
  80. Y1 = 1170
  81. Y2 = 1170
  82. End
  83. Begin VB.Line Line2
  84. BorderColor = &H80000014&
  85. Index = 0
  86. X1 = 240
  87. X2 = 5880
  88. Y1 = 1185
  89. Y2 = 1185
  90. End
  91. Begin VB.Line Line1
  92. BorderColor = &H80000010&
  93. Index = 1
  94. X1 = 240
  95. X2 = 5760
  96. Y1 = 2400
  97. Y2 = 2400
  98. End
  99. Begin VB.Line Line2
  100. BorderColor = &H80000014&
  101. Index = 1
  102. X1 = 240
  103. X2 = 5880
  104. Y1 = 2415
  105. Y2 = 2415
  106. End
  107. Begin VB.Label lblName
  108. Caption = "lblName"
  109. Height = 255
  110. Left = 1530
  111. TabIndex = 19
  112. Top = 510
  113. Width = 3975
  114. End
  115. Begin VB.Line Line1
  116. BorderColor = &H80000010&
  117. Index = 2
  118. X1 = 240
  119. X2 = 5880
  120. Y1 = 3870
  121. Y2 = 3870
  122. End
  123. Begin VB.Line Line2
  124. BorderColor = &H80000014&
  125. Index = 2
  126. X1 = 240
  127. X2 = 5880
  128. Y1 = 3885
  129. Y2 = 3885
  130. End
  131. Begin VB.Label Label2
  132. Caption = "Type:"
  133. Height = 255
  134. Left = 240
  135. TabIndex = 18
  136. Top = 1410
  137. Width = 1095
  138. End
  139. Begin VB.Label Label3
  140. Caption = "Location:"
  141. Height = 255
  142. Left = 270
  143. TabIndex = 17
  144. Top = 1680
  145. Width = 1215
  146. End
  147. Begin VB.Label Label4
  148. Caption = "Size:"
  149. Height = 255
  150. Left = 270
  151. TabIndex = 16
  152. Top = 1950
  153. Width = 1335
  154. End
  155. Begin VB.Label lblType
  156. Caption = "lblType"
  157. Height = 255
  158. Left = 1710
  159. TabIndex = 15
  160. Top = 1410
  161. Width = 3750
  162. End
  163. Begin VB.Label lblSize
  164. Caption = "lblSize"
  165. Height = 255
  166. Left = 1710
  167. TabIndex = 14
  168. Top = 1950
  169. Width = 3750
  170. End
  171. Begin VB.Label Label10
  172. Caption = "MS-DOS name:"
  173. Height = 255
  174. Left = 270
  175. TabIndex = 13
  176. Top = 2670
  177. Width = 1185
  178. End
  179. Begin VB.Label Label11
  180. Caption = "Created:"
  181. Height = 255
  182. Left = 270
  183. TabIndex = 12
  184. Top = 2940
  185. Width = 1215
  186. End
  187. Begin VB.Label Label12
  188. Caption = "Modified"
  189. Height = 255
  190. Left = 270
  191. TabIndex = 11
  192. Top = 3210
  193. Width = 1215
  194. End
  195. Begin VB.Label Label13
  196. Caption = "Accessed:"
  197. Height = 255
  198. Left = 270
  199. TabIndex = 10
  200. Top = 3480
  201. Width = 1215
  202. End
  203. Begin VB.Label Label14
  204. Caption = "Attributes:"
  205. Height = 285
  206. Left = 270
  207. TabIndex = 9
  208. Top = 4110
  209. Width = 915
  210. End
  211. Begin VB.Label lblDOSName
  212. Caption = "lblDOSName"
  213. Height = 195
  214. Left = 1710
  215. TabIndex = 8
  216. Top = 2670
  217. Width = 3750
  218. End
  219. Begin VB.Label lblCreated
  220. Caption = "lblCreated"
  221. Height = 285
  222. Left = 1710
  223. TabIndex = 7
  224. Top = 2940
  225. Width = 3750
  226. End
  227. Begin VB.Label lblModified
  228. Caption = "lblModified"
  229. Height = 195
  230. Left = 1710
  231. TabIndex = 6
  232. Top = 3210
  233. Width = 3750
  234. End
  235. Begin VB.Label lblAccessed
  236. Caption = "lblAccessed"
  237. Height = 195
  238. Left = 1710
  239. TabIndex = 5
  240. Top = 3480
  241. Width = 3750
  242. End
  243. End
  244. Attribute VB_Name = "ppgGeneral"
  245. Attribute VB_GlobalNameSpace = False
  246. Attribute VB_Creatable = True
  247. Attribute VB_PredeclaredId = False
  248. Attribute VB_Exposed = True
  249. ' ===========================================================================
  250. ' | THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF |
  251. ' | ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO |
  252. ' | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A |
  253. ' | PARTICULAR PURPOSE. |
  254. ' | Copyright (c) 1998-1999 Microsoft Corporation |
  255. ' ===========================================================================
  256. ' =============================================================================
  257. ' File: ppgGeneral.pag
  258. ' Project: FileExplorerSample
  259. ' Type: Property Page
  260. ' =============================================================================
  261. Option Explicit
  262. Implements IMMCPropertyPage
  263. ' When the property page is part of a multiple selection this variable holds the
  264. ' index within SelectedControls() of the particular object for which the instance of
  265. ' the property page is being displayed.
  266. Private m_Index As Integer
  267. ' MMC API DLL function declarations
  268. Private Declare Function MMCPropertyHelp Lib "mssnapr.dll" (ByVal HelpTopic As String) As Long
  269. Const SZ_FILE = "File"
  270. Const SZ_FOLDER = "Folder"
  271. Const subReadOnly = 0
  272. Const subArchive = 1
  273. Const subCompressed = 2
  274. Const subHidden = 3
  275. Const subSystem = 4
  276. Const SZ_SIZE_FORMAT = "#,##0 bytes"
  277. ' =============================================================================
  278. ' Method: IMMCPropertyPage_Initialize
  279. ' Type: Interface method
  280. ' Description: Called when the property page is created to pass the last
  281. ' parameter from MMCPropertySheet.AddPage to the property page
  282. '
  283. ' Parameters: Data The final parameter from MMCPropertySheet.AddPage
  284. ' Output: None
  285. ' Notes: Unlike a UserControl property page, SelectedControls(0) will
  286. ' contain the ScopeItems and/or ListItems for which the property sheet
  287. ' is being displayed. Changes can be made directly to an item's
  288. ' properties. The property page can notify the snap-in of the
  289. ' changes by calling ScopeItem.PropertyChanged or
  290. ' MMCListItem.PropertyChanged. Calling these methods will
  291. ' generate the ScopeItems_PropertyChanged or
  292. ' ResultViews_PropertyChanged event in the snap-in.
  293. ' =============================================================================
  294. '
  295. Private Sub IMMCPropertyPage_Initialize(ByVal Data As Variant, ByVal PropertySheet As SnapInLib.MMCPropertySheet)
  296. m_Index = Data
  297. Dim FolderObj As Scripting.Folder
  298. Dim FileObj As Scripting.File
  299. Dim FileItem As MMCListItem
  300. Dim FolderItem As ScopeItem
  301. ' If this is a scope item then get its data and fill the fields on the page
  302. If TypeOf SelectedControls(m_Index) Is ScopeItem Then
  303. Set FolderItem = SelectedControls(m_Index)
  304. Set FolderObj = FolderItem.Tag
  305. lblName.Caption = FolderObj.Name
  306. lblType.Caption = SZ_FOLDER
  307. lblLocation.Caption = FolderObj.Path
  308. lblSize.Caption = Format(FolderObj.Size, SZ_SIZE_FORMAT)
  309. lblDOSName.Caption = FolderObj.ShortName
  310. lblCreated.Caption = FolderObj.DateCreated
  311. lblModified.Caption = FolderObj.DateLastModified
  312. lblAccessed.Caption = FolderObj.DateLastAccessed
  313. If FolderObj.Attributes And ReadOnly Then optAttributes(subReadOnly) = Checked
  314. If FolderObj.Attributes And Archive Then optAttributes(subArchive) = Checked
  315. If FolderObj.Attributes And System Then optAttributes(subSystem) = Checked
  316. If FolderObj.Attributes And Hidden Then optAttributes(subHidden) = Checked
  317. If FolderObj.Attributes And Compressed Then optAttributes(subCompressed) = Checked
  318. ' Do the same for a list item
  319. ElseIf TypeOf SelectedControls(m_Index) Is MMCListItem Then
  320. Set FileItem = SelectedControls(m_Index)
  321. Set FileObj = FileItem.Tag
  322. lblName.Caption = FileObj.Name
  323. lblType.Caption = SZ_FILE
  324. lblLocation.Caption = FileObj.Path
  325. lblSize.Caption = Format(FileObj.Size, SZ_SIZE_FORMAT)
  326. lblDOSName.Caption = FileObj.ShortName
  327. lblCreated.Caption = FileObj.DateCreated
  328. lblModified.Caption = FileObj.DateLastModified
  329. lblAccessed.Caption = FileObj.DateLastAccessed
  330. If FileObj.Attributes And ReadOnly Then optAttributes(subReadOnly) = Checked
  331. If FileObj.Attributes And Archive Then optAttributes(subArchive) = Checked
  332. If FileObj.Attributes And System Then optAttributes(subSystem) = Checked
  333. If FileObj.Attributes And Hidden Then optAttributes(subHidden) = Checked
  334. If FileObj.Attributes And Compressed Then optAttributes(subCompressed) = Checked
  335. End If
  336. End Sub
  337. ' =============================================================================
  338. ' Method: IMMCPropertyPage_Help
  339. ' Type: Interface method
  340. ' Description: Called when the user clicks the Help button on a property sheet
  341. '
  342. ' Parameters: None
  343. ' Output: None
  344. ' Notes: Calls the MMC API function MMCPropertyHelp() to display a topic
  345. ' from MMC's merged help file.
  346. ' =============================================================================
  347. '
  348. Private Sub IMMCPropertyPage_Help()
  349. MMCPropertyHelp ("mmc.chm::/sag_MMCconcepts0_0.htm")
  350. End Sub
  351. ' =============================================================================
  352. ' Method: IMMCPropertyPage_GetDialogUnitSize
  353. ' Type: Interface method
  354. ' Description: Called when the property page is about to be created to allow
  355. ' the page to specify its size in dialog units.
  356. '
  357. ' Parameters: None
  358. ' Output: None
  359. ' Notes: Returns the recommended height and width values for a snap-in
  360. ' property page.
  361. ' =============================================================================
  362. '
  363. Private Sub IMMCPropertyPage_GetDialogUnitSize(Height As Variant, Width As Variant)
  364. Height = 218
  365. Width = 252
  366. End Sub
  367. ' =============================================================================
  368. ' Method: IMMCPropertyPage_QueryCancel
  369. ' Type: Interface method
  370. ' Description: Called when the user cancels the property sheet or wizard by
  371. ' pressing Esc, clicking the Cancel button, or clicking the 'X'
  372. ' button in the upper right corner.
  373. '
  374. ' Parameters: Allow - set to False to prevent the sheet or wizard from closing.
  375. ' Output: None
  376. ' Notes: None
  377. ' =============================================================================
  378. '
  379. Private Sub IMMCPropertyPage_QueryCancel(Allow As Boolean)
  380. End Sub
  381. ' =============================================================================
  382. ' Method: IMMCPropertyPage_Cancel
  383. ' Type: Interface method
  384. ' Description: Called when a property sheet or wizard is closed because the
  385. ' user clicked the Cancel button.
  386. '
  387. ' Parameters: None
  388. ' Output: None
  389. ' Notes: None
  390. ' =============================================================================
  391. '
  392. Private Sub IMMCPropertyPage_Cancel()
  393. End Sub
  394. ' =============================================================================
  395. ' Method: IMMCPropertyPage_Close
  396. ' Type: Interface method
  397. ' Description: Called when a property sheet or wizard is closed because the
  398. ' user clicked the 'X' button in the upper right corner.
  399. '
  400. ' Parameters: None
  401. ' Output: None
  402. ' Notes: None
  403. ' =============================================================================
  404. '
  405. Private Sub IMMCPropertyPage_Close()
  406. End Sub