www.pudn.com > SuperDLL2.zip > frmRegistry.frm
VERSION 5.00
Begin VB.Form frmRegistry
BorderStyle = 1 'Fixed Single
Caption = "Registry"
ClientHeight = 4020
ClientLeft = 30
ClientTop = 420
ClientWidth = 7770
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4020
ScaleWidth = 7770
StartUpPosition = 2 'CenterScreen
Begin VB.Frame Frame2
Height = 3312
Left = 4500
TabIndex = 8
Top = 300
Width = 2832
Begin VB.ListBox List1
Height = 1425
ItemData = "frmRegistry.frx":0000
Left = 360
List = "frmRegistry.frx":0002
MultiSelect = 1 'Simple
TabIndex = 9
Top = 1200
Width = 2052
End
Begin VB.Label Label4
Caption = "HKEY_LOCAL_MACHINE \ System \ CurrentControlSet \ control \ MediaResources"
Height = 612
Left = 360
TabIndex = 10
Top = 360
Width = 2172
End
End
Begin VB.Frame Frame1
Height = 3312
Left = 360
TabIndex = 3
Top = 300
Width = 3762
Begin VB.TextBox Text1
Height = 288
Left = 600
Locked = -1 'True
TabIndex = 0
Top = 1200
Width = 2532
End
Begin VB.TextBox Text2
Height = 288
Left = 600
Locked = -1 'True
TabIndex = 1
Top = 1920
Width = 2532
End
Begin VB.TextBox Text3
Height = 288
Left = 600
Locked = -1 'True
TabIndex = 2
Top = 2640
Width = 2532
End
Begin VB.Label Label5
Caption = "HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion"
Height = 492
Left = 360
TabIndex = 7
Top = 360
Width = 3252
End
Begin VB.Label Label1
Caption = "ProductName :"
Height = 252
Left = 600
TabIndex = 6
Top = 960
Width = 2532
End
Begin VB.Label Label2
Caption = "InstallDate :"
Height = 252
Left = 600
TabIndex = 5
Top = 1680
Width = 2532
End
Begin VB.Label Label3
Caption = "DigitalProductId :"
Height = 252
Left = 600
TabIndex = 4
Top = 2400
Width = 2532
End
End
End
Attribute VB_Name = "frmRegistry"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Activate()
Dim astr As String, l As Long
l = 0
While EnumKey(HKEY_LOCAL_MACHINE, "System\CurrentControlSet\control\MediaResources", l, astr)
List1.AddItem astr
l = l + 1
Wend
If l = 0 Then MsgBox "NO ITEMS", vbExclamation, "EnumKey"
End Sub
Private Sub Form_Load()
' QueryValue can get any type of key :
' ( REG_SZ , REG_EXPAND_SZ, REG_BINARY, REG_DWORD, REG_MULTI_SZ )
' REG_MULTI_SZ return array of string
If isNT2000XP Then
Label5.Caption = "HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion"
Label2.Caption = "InstallDate"
Text1.Text = QueryValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName")
Text2.Text = QueryValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion", "InstallDate")
Text3.Text = BinToHexR(QueryValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion", "DigitalProductId"))
' The next 3 lines have the same result as the 3 above
' Text1.Text = GetStringValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName")
' Text2.Text = GetDWordValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "InstallDate")
' Text3.Text = BinToHexR(GetBinaryValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "DigitalProductId"))
Else
Label5.Caption = "HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion"
Label2.Caption = "ProductKey"
Text1.Text = QueryValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion", "ProductName")
Text2.Text = QueryValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion", "ProductKey")
Text3.Text = BinToHexR(QueryValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion", "DigitalProductId"))
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmMenu.Show
End Sub