📄 frmmain.frm
字号:
Index = 0
Left = -74775
TabIndex = 20
Top = 525
Width = 1590
End
Begin VB.Image imgNetwork
Height = 480
Left = 300
Top = 3075
Width = 480
End
Begin VB.Image imgCPU
Height = 480
Left = 225
Top = 825
Width = 480
End
Begin VB.Image imgMSO
Height = 480
Left = -74775
Top = 4350
Width = 480
End
Begin VB.Image imgMain
Height = 480
Index = 7
Left = -74775
Picture = "frmMain.frx":0684
Top = 750
Width = 480
End
Begin VB.Image imgWindows
Height = 480
Left = -74775
Top = 825
Width = 480
End
Begin VB.Image imgIE
Height = 480
Left = -74775
Top = 2775
Width = 480
End
Begin VB.Image imgMain
Height = 480
Index = 4
Left = -74775
Picture = "frmMain.frx":0F4E
Top = 2100
Width = 480
End
End
Begin VB.Label lblWinInfoVer
AutoSize = -1 'True
Height = 195
Left = 1425
TabIndex = 2
ToolTipText = "The current version of WinInfo"
Top = 5850
Width = 45
End
Begin VB.Label lblMain
Caption = "WinInfo Version:"
Height = 195
Index = 13
Left = 150
TabIndex = 1
ToolTipText = "The current version of WinInfo"
Top = 5850
Width = 1200
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuOutput
Caption = "E&xport Data"
Begin VB.Menu mnuText
Caption = "Text File (.txt)"
End
Begin VB.Menu mnuCSV
Caption = "Comma Separated Values File (.csv)"
End
End
Begin VB.Menu mnu
Caption = "-"
End
Begin VB.Menu mnuFileExit
Caption = "E&xit"
End
End
Begin VB.Menu mnuAbout
Caption = "A&bout"
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'-----------------------------------------
' Windows Info by Richard Gunton 16/5/01
' http://www.gunton.8k.com
'-----------------------------------------
Dim newname As String
Dim neworg As String
Private Sub cmdChgNm_Click()
newname = InputBox("Enter a new value for the registered owner", "Change registration details")
subSaveRegistryKey "SOFTWARE\Microsoft\Windows NT\CurrentVersion", "RegisteredOwner", newname
lstWindows.RemoveItem (4)
lstWindows.AddItem "Registered Owner: " & newname, 4
End Sub
Private Sub cmdChgOrg_Click()
neworg = InputBox("Enter a new value for the registered organisation", "Change registration details")
subSaveRegistryKey "SOFTWARE\Microsoft\Windows NT\CurrentVersion", "RegisteredOrganization", neworg
lstWindows.RemoveItem (5)
lstWindows.AddItem "Registered Organisation: " & neworg, 5
End Sub
Private Sub cmdOK_Click()
End
End Sub
Private Sub cmdOwnerChange_Click()
MsgBox InputBox("Enter a new value", "WinInfo")
End Sub
Private Sub Form_Load()
Me.Caption = Me.Caption & " " & App.Major & "." & App.Minor
sstMain.Tab = 0
LoadImages
lblWinInfoVer.Caption = App.Major & "." & App.Minor
lblVer.Caption = App.Major & "." & App.Minor
lstCPU.AddItem ("Number of CPUs: " & CPUCount)
lstCPU.AddItem ("Processor Name: " & fnGetRegistryKey("HARDWARE\DESCRIPTION\System\CentralProcessor\0", "ProcessorNameString", bHKeyLocalMachine:=True))
lstCPU.AddItem ("Processor Family: " & fnGetRegistryKey("HARDWARE\DESCRIPTION\System\CentralProcessor\0", "Identifier", bHKeyLocalMachine:=True))
lstCPU.AddItem ("Vendor ID: " & fnGetRegistryKey("HARDWARE\DESCRIPTION\System\CentralProcessor\0", "VendorIdentifier", bHKeyLocalMachine:=True))
lstCPU.AddItem ("CPU Speed: ~" & fnGetRegistryKey("HARDWARE\DESCRIPTION\System\CentralProcessor\0", "~mhz", bHKeyLocalMachine:=True) & "MHz")
lstRAM.AddItem ("Physical Memory: " & MemoryTotal & " bytes")
lstRAM.AddItem ("Available Memory: " & MemoryAvailable & " bytes")
lstNetwork.AddItem ("Computer Name: \\" & fnGetRegistryKey("SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName", "ComputerName", bHKeyLocalMachine:=True))
lstNetwork.AddItem ("User Name: " & UserName)
lstWindows.AddItem ("Product Name: " & fnGetRegistryKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName", bHKeyLocalMachine:=True))
lstWindows.AddItem ("Build Number: " & fnGetRegistryKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion", "CurrentBuildNumber", bHKeyLocalMachine:=True))
lstWindows.AddItem ("%WINDIR%: " & fnGetRegistryKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion", "PathName", bHKeyLocalMachine:=True))
lstWindows.AddItem ("Install Dir: " & fnGetRegistryKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion", "SourcePath", bHKeyLocalMachine:=True))
lstWindows.AddItem ("Registered Owner: " & fnGetRegistryKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion", "RegisteredOwner", bHKeyLocalMachine:=True))
lstWindows.AddItem ("Registered Organisation: " & fnGetRegistryKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion", "RegisteredOrganization", bHKeyLocalMachine:=True))
GetBootMode
lstWindows.AddItem ("User Name: " & UserName)
lstIE.AddItem ("IE Version: " & fnGetRegistryKey("SOFTWARE\Microsoft\Internet Explorer", "Version", bHKeyLocalMachine:=True))
lstIE.AddItem ("IE Build: " & fnGetRegistryKey("SOFTWARE\Microsoft\Internet Explorer", "Build", bHKeyLocalMachine:=True))
lstIE.AddItem "IE Path: " & Left(fnGetRegistryKey("SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE", "path", bHKeyLocalMachine:=True), Len(fnGetRegistryKey("SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE", "path", bHKeyLocalMachine:=True)) - 1)
End Sub
Private Sub LoadImages()
imgCPU.Picture = LoadResPicture("chip", vbResIcon)
imgRAM.Picture = LoadResPicture("chip2", vbResIcon)
imgNetwork.Picture = LoadResPicture("net", vbResIcon)
imgWindows.Picture = LoadResPicture("win", vbResIcon)
imgIE.Picture = LoadResPicture("ie", vbResIcon)
imgMSO.Picture = LoadResPicture("mso", vbResIcon)
End Sub
Public Function UserName() As String
Dim lpBuffer As String
Dim j
lpBuffer = Space$(255)
GetUserName lpBuffer, Len(lpBuffer)
j = InStr(lpBuffer, Chr$(0))
If j > 0 Then UserName = Left$(lpBuffer, j - 1)
End Function
Function CPUCount() As Integer
Dim lpSystemInfo As SYSTEM_INFO
GetSystemInfo lpSystemInfo
CPUCount = lpSystemInfo.dwNumberOfProcessors
End Function
Function GetBootMode()
mode = StartMode
If mode = 0 Then
lstWindows.AddItem "Boot Mode: Normal"
ElseIf mode = 1 Then
lstWindows.AddItem "Boot Mode: Safe Mode"
ElseIf mode = 2 Then
lstWindows.AddItem "Boot Mode: Safe Mode with Networking"
End If
End Function
Private Sub lstCPU_dblClick()
MsgBox "Displays information about your CPU", vbInformation, "WinInfo"
End Sub
Private Sub lstIE_dblClick()
MsgBox "Displays information about Internet Explorer", vbInformation, "WinInfo"
End Sub
Private Sub lstNetwork_dblClick()
MsgBox "Displays information about your network", vbInformation, "WinInfo"
End Sub
Private Sub lstOffice_dblClick()
MsgBox "Displays information about Microsoft Office (if installed)", vbInformation, "WinInfo"
End Sub
Private Sub lstRAM_dblClick()
MsgBox "Displays information about the memory in your PC", vbInformation, "WinInfo"
End Sub
Private Sub lstWindows_dblClick()
MsgBox "Displays information about Microsoft Windows", vbInformation, "WinInfo"
End Sub
Private Sub mnuAbout_Click()
sstMain.Tab = 3
End Sub
Private Sub mnuCSV_Click()
Export ("CSV")
End Sub
Private Sub mnuFileExit_Click()
End
End Sub
Private Sub mnuText_Click()
Export ("Txt")
End Sub
Private Sub tmrUpdate_Timer()
lstRAM.RemoveItem (1)
lstRAM.AddItem "Available Memory: " & MemoryAvailable & " bytes", 1
End Sub
Private Sub Export(filetype As String)
Select Case filetype
Case "Txt"
With cdlMain
.FileName = "WinInfo.txt"
.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
.DialogTitle = "Output as text file"
End With
cdlMain.ShowOpen
Open cdlMain.FileName For Append As #1
Print #1, "Ginger Software WinInfo v" & App.Major & "." & App.Minor
Print #1, "============================"
Print #1,
Print #1, "Data exported on: " & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " at " & Hour(Now) & ":" & Minute(Now)
Print #1,
Print #1, "Central Processing Unit (CPU)"
Print #1, "-----------------------------"
For c = 0 To 5
Print #1, lstCPU.List(c)
Next c
Print #1, "Random Access Memory (RAM)"
Print #1, "--------------------------"
For r = 0 To 2
Print #1, lstRAM.List(r)
Next r
Print #1, "Network"
Print #1, "-------"
For n = 0 To 2
Print #1, lstNetwork.List(n)
Next n
Print #1, "Microsoft Windows"
Print #1, "-----------------"
For w = 0 To 8
Print #1, lstWindows.List(w)
Next w
Print #1, "Internet Explorer"
Print #1, "-----------------"
For i = 0 To 2
Print #1, lstIE.List(i)
Next i
Close #1
Case "CSV"
With cdlMain
.FileName = "WinInfo.csv"
.Filter = "CSV Files (*.csv)|*.csv|All Files (*.*)|*.*"
.DialogTitle = "Output as CSV file"
End With
cdlMain.ShowOpen
Open cdlMain.FileName For Append As #1
Print #1, "Ginger Software WinInfo v" & App.Major & "." & App.Minor
Print #1, "============================"
Print #1,
Print #1, "Data exported on: " & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " at " & Hour(Now) & ":" & Minute(Now)
Print #1,
Print #1, "Central Processing Unit (CPU)"
Print #1, "-----------------------------"
For c = 0 To 4
Print #1, c + 1 & ".," & lstCPU.List(c)
Next c
Print #1,
Print #1, "Random Access Memory (RAM)"
Print #1, "--------------------------"
For r = 0 To 1
Print #1, r + 1 & ".," & lstRAM.List(r)
Next r
Print #1,
Print #1, "Network"
Print #1, "-------"
For n = 0 To 1
Print #1, n + 1 & ".," & lstNetwork.List(n)
Next n
Print #1,
Print #1, "Microsoft Windows"
Print #1, "-----------------"
For w = 0 To 7
Print #1, w + 1 & ".," & lstWindows.List(w)
Next w
Print #1,
Print #1, "Internet Explorer"
Print #1, "-----------------"
For i = 0 To 2
Print #1, i + 1 & ".," & lstIE.List(i)
Next i
Close #1
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -