home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{B190576C-254A-11D2-B61E-C80424DEEF17}#45.0#0"; "LCocx.ocx"
- Begin VB.Form frmRegistry
- BorderStyle = 1 'Fixed Single
- Caption = "Registry"
- ClientHeight = 5700
- ClientLeft = 36
- ClientTop = 324
- ClientWidth = 9492
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5700
- ScaleWidth = 9492
- StartUpPosition = 2 'CenterScreen
- Begin LCocx98.LCocx LCocx1
- Left = 4560
- Top = 2640
- _ExtentX = 656
- _ExtentY = 656
- End
- Begin VB.CommandButton Command9
- Caption = "DeleteKey HKEY_CURRENT_USER, ""SAMPLEKEY"""
- Height = 492
- Left = 120
- TabIndex = 8
- Top = 4920
- Width = 5412
- End
- Begin VB.CommandButton Command8
- Caption = "DeleteValue HKEY_CURRENT_USER, ""SAMPLEKEY"", ""SAMPLE2"""
- Height = 492
- Left = 120
- TabIndex = 7
- Top = 4320
- Width = 5412
- End
- Begin VB.CommandButton Command7
- Caption = "ret4 = QueryValue(HKEY_LOCAL_MACHINE, ""SOFTWARE\Microsoft\Windows\CurrentVersion\Setup"", ""SysDir"")"
- Height = 492
- Left = 120
- TabIndex = 6
- Top = 3720
- Width = 5412
- End
- Begin VB.CommandButton Command6
- Caption = "ret3 = ValueCount(HKEY_LOCAL_MACHINE, ""SOFTWARE\Microsoft\Windows\CurrentVersion\Setup"")"
- Height = 492
- Left = 120
- TabIndex = 5
- Top = 3120
- Width = 5412
- End
- Begin VB.CommandButton Command5
- Caption = "Ret2 = KeyExists(HKEY_CURRENT_USER, ""SAMPLEKEY"")"
- Height = 492
- Left = 120
- TabIndex = 4
- Top = 2520
- Width = 5412
- End
- Begin VB.CommandButton Command4
- Caption = "Ret1 = KeyCount(HKEY_LOCAL_MACHINE, ""SOFTWARE\Microsoft\Windows\CurrentVersion\Setup"")"
- Height = 492
- Left = 120
- TabIndex = 3
- Top = 1920
- Width = 5412
- End
- Begin VB.CommandButton Command3
- Caption = "SetKeyValue HKEY_CURRENT_USER, ""SAMPLEKEY"", ""SAMPLE2"", 123456, ""Binary"""
- Height = 492
- Left = 120
- TabIndex = 2
- Top = 1320
- Width = 5412
- End
- Begin VB.CommandButton Command2
- Caption = "SetKeyValue HKEY_CURRENT_USER, ""SAMPLEKEY"", """", ""HELLO WORLD"", ""String"""
- Height = 492
- Left = 120
- TabIndex = 1
- Top = 720
- Width = 5412
- End
- Begin VB.CommandButton Command1
- Caption = "CreateNewKey HKEY_CURRENT_USER, ""SAMPLEKEY"""
- Height = 492
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 5412
- End
- Begin VB.Label Label9
- AutoSize = -1 'True
- Caption = "Return:"
- Height = 192
- Left = 6240
- TabIndex = 17
- Top = 5160
- Width = 504
- End
- Begin VB.Label Label8
- AutoSize = -1 'True
- Caption = "Return:"
- Height = 192
- Left = 6240
- TabIndex = 16
- Top = 4560
- Width = 504
- End
- Begin VB.Label Label7
- AutoSize = -1 'True
- Caption = "Return:"
- Height = 192
- Left = 6240
- TabIndex = 15
- Top = 3960
- Width = 504
- End
- Begin VB.Label Label6
- AutoSize = -1 'True
- Caption = "Return:"
- Height = 192
- Left = 6240
- TabIndex = 14
- Top = 3360
- Width = 504
- End
- Begin VB.Label Label5
- AutoSize = -1 'True
- Caption = "Return:"
- Height = 192
- Left = 6240
- TabIndex = 13
- Top = 2760
- Width = 504
- End
- Begin VB.Label Label4
- AutoSize = -1 'True
- Caption = "Return:"
- Height = 192
- Left = 6240
- TabIndex = 12
- Top = 2160
- Width = 504
- End
- Begin VB.Label Label3
- AutoSize = -1 'True
- Caption = "Return:"
- Height = 192
- Left = 6240
- TabIndex = 11
- Top = 1560
- Width = 504
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- Caption = "Return:"
- Height = 192
- Left = 6240
- TabIndex = 10
- Top = 960
- Width = 504
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "Return:"
- Height = 192
- Left = 6240
- TabIndex = 9
- Top = 360
- Width = 504
- End
- Attribute VB_Name = "frmRegistry"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Command1_Click()
- LCocx1.CreateNewKey HKEY_CURRENT_USER, "SAMPLEKEY"
- Label1 = "Return: Nothing"
- End Sub
- Private Sub Command2_Click()
- LCocx1.SetKeyValue HKEY_CURRENT_USER, "SAMPLEKEY", "", "HELLO WORLD", "String"
- 'It sets "HELLO WORLD" to the "Default Value"
- 'When setting a value, if you don't specify "String" or "Binary"
- 'it will be treated as "String"
- Label2 = "Return: Nothing"
- End Sub
- Private Sub Command3_Click()
- LCocx1.SetKeyValue HKEY_CURRENT_USER, "SAMPLEKEY", "SAMPLE2", 123456, "Binary"
- 'It sets "123456" to the "SAMPLE2 Value" in binary format
- 'When setting a value, if you don't specify "String" or "Binary"
- 'it will be treated as "String"
- Label3 = "Return: Nothing"
- End Sub
- Private Sub Command4_Click()
- Ret1 = LCocx1.KeyCount(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Setup")
- 'Counts number of keys under the specified key
- Label4 = "Return: " & Ret1
- End Sub
- Private Sub Command5_Click()
- Ret2 = LCocx1.KeyExists(HKEY_CURRENT_USER, "SAMPLEKEY")
- 'Checks if a Key exists
- Label5 = "Return: " & Ret2
- End Sub
- Private Sub Command6_Click()
- ret3 = LCocx1.ValueCount(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Setup")
- 'Counts number of values under the specified key
- Label6 = "Return: " & ret3
- End Sub
- Private Sub Command7_Click()
- ret4 = LCocx1.QueryValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Setup", "SysDir")
- 'Returns the "Setting" of the "SysDir Value" under the specified key
- Label7 = "Return: " & ret4
- End Sub
- Private Sub Command8_Click()
- LCocx1.DeleteValue HKEY_CURRENT_USER, "SAMPLEKEY", "SAMPLE2"
- Label8 = "Return: Nothing"
- End Sub
- Private Sub Command9_Click()
- LCocx1.DeleteKey HKEY_CURRENT_USER, "SAMPLEKEY"
- Label9 = "Return: Nothing"
- End Sub
-