VERSION 5.00 Begin VB.PropertyPage ppgGeneral Caption = "General" ClientHeight = 5040 ClientLeft = 0 ClientTop = 0 ClientWidth = 4650 PaletteMode = 0 'Halftone ScaleHeight = 5040 ScaleWidth = 4650 Begin VB.CheckBox optAttributes Caption = "&Read-only" Enabled = 0 'False Height = 195 Index = 0 Left = 1710 TabIndex = 4 Top = 4110 Width = 1095 End Begin VB.CheckBox optAttributes Caption = "Ar&chive" Enabled = 0 'False Height = 195 Index = 1 Left = 1710 TabIndex = 3 Top = 4380 Width = 1095 End Begin VB.CheckBox optAttributes Caption = "Co&mpress" Enabled = 0 'False Height = 195 Index = 2 Left = 1710 TabIndex = 2 Top = 4650 Width = 1095 End Begin VB.CheckBox optAttributes Caption = "Hi&dden" Enabled = 0 'False Height = 195 Index = 3 Left = 3240 TabIndex = 1 Top = 4110 Width = 1095 End Begin VB.CheckBox optAttributes Caption = "System" Enabled = 0 'False Height = 195 Index = 4 Left = 3240 TabIndex = 0 Top = 4380 Width = 1095 End Begin VB.Label lblLocation Caption = "lblLocation" Height = 255 Left = 1695 TabIndex = 20 Top = 1665 Width = 3750 End Begin VB.Image imgDisplay Height = 735 Left = 360 Top = 240 Width = 735 End Begin VB.Line Line1 BorderColor = &H80000010& Index = 0 X1 = 240 X2 = 5880 Y1 = 1170 Y2 = 1170 End Begin VB.Line Line2 BorderColor = &H80000014& Index = 0 X1 = 240 X2 = 5880 Y1 = 1185 Y2 = 1185 End Begin VB.Line Line1 BorderColor = &H80000010& Index = 1 X1 = 240 X2 = 5760 Y1 = 2400 Y2 = 2400 End Begin VB.Line Line2 BorderColor = &H80000014& Index = 1 X1 = 240 X2 = 5880 Y1 = 2415 Y2 = 2415 End Begin VB.Label lblName Caption = "lblName" Height = 255 Left = 1530 TabIndex = 19 Top = 510 Width = 3975 End Begin VB.Line Line1 BorderColor = &H80000010& Index = 2 X1 = 240 X2 = 5880 Y1 = 3870 Y2 = 3870 End Begin VB.Line Line2 BorderColor = &H80000014& Index = 2 X1 = 240 X2 = 5880 Y1 = 3885 Y2 = 3885 End Begin VB.Label Label2 Caption = "Type:" Height = 255 Left = 240 TabIndex = 18 Top = 1410 Width = 1095 End Begin VB.Label Label3 Caption = "Location:" Height = 255 Left = 270 TabIndex = 17 Top = 1680 Width = 1215 End Begin VB.Label Label4 Caption = "Size:" Height = 255 Left = 270 TabIndex = 16 Top = 1950 Width = 1335 End Begin VB.Label lblType Caption = "lblType" Height = 255 Left = 1710 TabIndex = 15 Top = 1410 Width = 3750 End Begin VB.Label lblSize Caption = "lblSize" Height = 255 Left = 1710 TabIndex = 14 Top = 1950 Width = 3750 End Begin VB.Label Label10 Caption = "MS-DOS name:" Height = 255 Left = 270 TabIndex = 13 Top = 2670 Width = 1185 End Begin VB.Label Label11 Caption = "Created:" Height = 255 Left = 270 TabIndex = 12 Top = 2940 Width = 1215 End Begin VB.Label Label12 Caption = "Modified" Height = 255 Left = 270 TabIndex = 11 Top = 3210 Width = 1215 End Begin VB.Label Label13 Caption = "Accessed:" Height = 255 Left = 270 TabIndex = 10 Top = 3480 Width = 1215 End Begin VB.Label Label14 Caption = "Attributes:" Height = 285 Left = 270 TabIndex = 9 Top = 4110 Width = 915 End Begin VB.Label lblDOSName Caption = "lblDOSName" Height = 195 Left = 1710 TabIndex = 8 Top = 2670 Width = 3750 End Begin VB.Label lblCreated Caption = "lblCreated" Height = 285 Left = 1710 TabIndex = 7 Top = 2940 Width = 3750 End Begin VB.Label lblModified Caption = "lblModified" Height = 195 Left = 1710 TabIndex = 6 Top = 3210 Width = 3750 End Begin VB.Label lblAccessed Caption = "lblAccessed" Height = 195 Left = 1710 TabIndex = 5 Top = 3480 Width = 3750 End End Attribute VB_Name = "ppgGeneral" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True ' =========================================================================== ' | THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF | ' | ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO | ' | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A | ' | PARTICULAR PURPOSE. | ' | Copyright (c) 1998-1999 Microsoft Corporation | ' =========================================================================== ' ============================================================================= ' File: ppgGeneral.pag ' Project: FileExplorerSample ' Type: Property Page ' ============================================================================= Option Explicit Implements IMMCPropertyPage ' When the property page is part of a multiple selection this variable holds the ' index within SelectedControls() of the particular object for which the instance of ' the property page is being displayed. Private m_Index As Integer ' MMC API DLL function declarations Private Declare Function MMCPropertyHelp Lib "mssnapr.dll" (ByVal HelpTopic As String) As Long Const SZ_FILE = "File" Const SZ_FOLDER = "Folder" Const subReadOnly = 0 Const subArchive = 1 Const subCompressed = 2 Const subHidden = 3 Const subSystem = 4 Const SZ_SIZE_FORMAT = "#,##0 bytes" ' ============================================================================= ' Method: IMMCPropertyPage_Initialize ' Type: Interface method ' Description: Called when the property page is created to pass the last ' parameter from MMCPropertySheet.AddPage to the property page ' ' Parameters: Data The final parameter from MMCPropertySheet.AddPage ' Output: None ' Notes: Unlike a UserControl property page, SelectedControls(0) will ' contain the ScopeItems and/or ListItems for which the property sheet ' is being displayed. Changes can be made directly to an item's ' properties. The property page can notify the snap-in of the ' changes by calling ScopeItem.PropertyChanged or ' MMCListItem.PropertyChanged. Calling these methods will ' generate the ScopeItems_PropertyChanged or ' ResultViews_PropertyChanged event in the snap-in. ' ============================================================================= ' Private Sub IMMCPropertyPage_Initialize(ByVal Data As Variant, ByVal PropertySheet As SnapInLib.MMCPropertySheet) m_Index = Data Dim FolderObj As Scripting.Folder Dim FileObj As Scripting.File Dim FileItem As MMCListItem Dim FolderItem As ScopeItem ' If this is a scope item then get its data and fill the fields on the page If TypeOf SelectedControls(m_Index) Is ScopeItem Then Set FolderItem = SelectedControls(m_Index) Set FolderObj = FolderItem.Tag lblName.Caption = FolderObj.Name lblType.Caption = SZ_FOLDER lblLocation.Caption = FolderObj.Path lblSize.Caption = Format(FolderObj.Size, SZ_SIZE_FORMAT) lblDOSName.Caption = FolderObj.ShortName lblCreated.Caption = FolderObj.DateCreated lblModified.Caption = FolderObj.DateLastModified lblAccessed.Caption = FolderObj.DateLastAccessed If FolderObj.Attributes And ReadOnly Then optAttributes(subReadOnly) = Checked If FolderObj.Attributes And Archive Then optAttributes(subArchive) = Checked If FolderObj.Attributes And System Then optAttributes(subSystem) = Checked If FolderObj.Attributes And Hidden Then optAttributes(subHidden) = Checked If FolderObj.Attributes And Compressed Then optAttributes(subCompressed) = Checked ' Do the same for a list item ElseIf TypeOf SelectedControls(m_Index) Is MMCListItem Then Set FileItem = SelectedControls(m_Index) Set FileObj = FileItem.Tag lblName.Caption = FileObj.Name lblType.Caption = SZ_FILE lblLocation.Caption = FileObj.Path lblSize.Caption = Format(FileObj.Size, SZ_SIZE_FORMAT) lblDOSName.Caption = FileObj.ShortName lblCreated.Caption = FileObj.DateCreated lblModified.Caption = FileObj.DateLastModified lblAccessed.Caption = FileObj.DateLastAccessed If FileObj.Attributes And ReadOnly Then optAttributes(subReadOnly) = Checked If FileObj.Attributes And Archive Then optAttributes(subArchive) = Checked If FileObj.Attributes And System Then optAttributes(subSystem) = Checked If FileObj.Attributes And Hidden Then optAttributes(subHidden) = Checked If FileObj.Attributes And Compressed Then optAttributes(subCompressed) = Checked End If End Sub ' ============================================================================= ' Method: IMMCPropertyPage_Help ' Type: Interface method ' Description: Called when the user clicks the Help button on a property sheet ' ' Parameters: None ' Output: None ' Notes: Calls the MMC API function MMCPropertyHelp() to display a topic ' from MMC's merged help file. ' ============================================================================= ' Private Sub IMMCPropertyPage_Help() MMCPropertyHelp ("mmc.chm::/sag_MMCconcepts0_0.htm") End Sub ' ============================================================================= ' Method: IMMCPropertyPage_GetDialogUnitSize ' Type: Interface method ' Description: Called when the property page is about to be created to allow ' the page to specify its size in dialog units. ' ' Parameters: None ' Output: None ' Notes: Returns the recommended height and width values for a snap-in ' property page. ' ============================================================================= ' Private Sub IMMCPropertyPage_GetDialogUnitSize(Height As Variant, Width As Variant) Height = 218 Width = 252 End Sub ' ============================================================================= ' Method: IMMCPropertyPage_QueryCancel ' Type: Interface method ' Description: Called when the user cancels the property sheet or wizard by ' pressing Esc, clicking the Cancel button, or clicking the 'X' ' button in the upper right corner. ' ' Parameters: Allow - set to False to prevent the sheet or wizard from closing. ' Output: None ' Notes: None ' ============================================================================= ' Private Sub IMMCPropertyPage_QueryCancel(Allow As Boolean) End Sub ' ============================================================================= ' Method: IMMCPropertyPage_Cancel ' Type: Interface method ' Description: Called when a property sheet or wizard is closed because the ' user clicked the Cancel button. ' ' Parameters: None ' Output: None ' Notes: None ' ============================================================================= ' Private Sub IMMCPropertyPage_Cancel() End Sub ' ============================================================================= ' Method: IMMCPropertyPage_Close ' Type: Interface method ' Description: Called when a property sheet or wizard is closed because the ' user clicked the 'X' button in the upper right corner. ' ' Parameters: None ' Output: None ' Notes: None ' ============================================================================= ' Private Sub IMMCPropertyPage_Close() End Sub