home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
- Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
- Begin VB.Form frmTest
- BorderStyle = 3 'Fixed Dialog
- Caption = "Test SG Version Info"
- ClientHeight = 6315
- ClientLeft = 2205
- ClientTop = 2385
- ClientWidth = 8625
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 6315
- ScaleWidth = 8625
- ShowInTaskbar = 0 'False
- Begin MSComDlg.CommonDialog cmnDlg
- Left = 5760
- Top = 1800
- _ExtentX = 847
- _ExtentY = 847
- _Version = 327681
- End
- Begin VB.Frame Frame1
- Caption = "Version Info"
- Height = 5415
- Left = 135
- TabIndex = 3
- Top = 720
- Width = 8340
- Begin ComctlLib.ListView lvwVerInfo
- Height = 4920
- Left = 135
- TabIndex = 4
- Top = 360
- Width = 8025
- _ExtentX = 14155
- _ExtentY = 8678
- View = 3
- LabelEdit = 1
- LabelWrap = -1 'True
- HideSelection = -1 'True
- _Version = 327682
- ForeColor = -2147483640
- BackColor = -2147483643
- BorderStyle = 1
- Appearance = 1
- NumItems = 2
- BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
- Key = ""
- Object.Tag = ""
- Text = "Value Name"
- Object.Width = 2540
- EndProperty
- BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
- SubItemIndex = 1
- Key = ""
- Object.Tag = ""
- Text = "Value"
- Object.Width = 7937
- EndProperty
- End
- End
- Begin VB.CommandButton cmdBrowse
- Caption = "&Browse..."
- Height = 375
- Left = 7155
- TabIndex = 2
- Top = 225
- Width = 1275
- End
- Begin VB.TextBox txtFile
- Height = 375
- Left = 675
- TabIndex = 0
- Top = 225
- Width = 6270
- End
- Begin VB.Label Label1
- Caption = "File:"
- Height = 330
- Left = 180
- TabIndex = 1
- Top = 270
- Width = 555
- End
- Attribute VB_Name = "frmTest"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Dim VerInfo As VersionInfo
- Private Sub InsertItem(name$, value$)
- Dim item As ListItem
- Set item = lvwVerInfo.ListItems.Add(, , name)
- item.SubItems(1) = value
-
- End Sub
- Private Sub ShowVerInfo()
- On Error GoTo Error_
- lvwVerInfo.ListItems.Clear
- Frame1.Caption = "Version Info (" + txtFile.Text + ")"
- VerInfo.Path = txtFile.Text
- If VerInfo.InfoExist Then
- InsertItem "FileDescription", VerInfo.FileDescription
- InsertItem "ProductName", VerInfo.ProductName
- InsertItem "FileVersion", VerInfo.FileVersion
- InsertItem "ProductVersion", VerInfo.ProductVersion
- InsertItem "CompanyName", VerInfo.CompanyName
- InsertItem "InternalName", VerInfo.InternalName
- InsertItem "OriginalFilename", VerInfo.OriginalFilename
- InsertItem "PrivateBuild", VerInfo.PrivateBuild
- InsertItem "SpecialBuild", VerInfo.SpecialBuild
- InsertItem "LegalCopyright", VerInfo.LegalCopyright
- InsertItem "LegalTrademarks", VerInfo.GetValue("StringFileInfo", "LegalTrademarks")
- InsertItem "Language", VerInfo.LanguageName
- InsertItem "Comments", VerInfo.Comments
- InsertItem "OS", VerInfo.FileOSString
- Else
- InsertItem GetFilename(txtFile.Text), "File does not contain version info resource"
- End If
- Exit Sub
- Error_:
- MsgBox Error$
- End Sub
- Private Sub cmdBrowse_Click()
- On Error GoTo Error_
- cmnDlg.Filter = "Win32 Modules (*.exe,*.dll,*.fon,*.ttf)|*.exe;*.dll;*.fon;*.ttf|All Files (*.*)|*.*||"
- cmnDlg.ShowOpen
- If (cmnDlg.filename <> "") Then
- txtFile = cmnDlg.filename
- ShowVerInfo
- End If
- Exit Sub
- Error_:
- MsgBox Error$
- End Sub
- Private Sub Form_Load()
- Set VerInfo = New VersionInfo
- End Sub
- Private Sub txtFile_KeyDown(KeyCode As Integer, Shift As Integer)
- If (KeyCode = vbKeyReturn) Then
- ShowVerInfo
- End If
- End Sub
-