Create A Modual Put This Code In There:
Public Sub CreateKey(Folder As String, Value As String)
Dim b As Object
On Error Resume Next
Set b = CreateObject("wscript.shell")
b.RegWrite Folder, Value
End Sub
Public Function ReadKey(Value As String) As String
Dim b As Object
On Error Resume Next
Set b = CreateObject("wscript.shell")
r = b.RegRead(Value)
ReadKey = r
End Function
Public Sub CreateIntegerKey(Folder As String, Value As Integer)
Dim b As Object
On Error Resume Next
Set b = CreateObject("wscript.shell")
b.RegWrite Folder, Value, "REG_DWORD"
End Sub
Public Sub DeleteKey(Value As String)
Dim b As Object
On Error Resume Next
Set b = CreateObject("Wscript.Shell")
b.RegDelete Value
End Sub
===================
In your VB6 Project Just Call The Sub To Read And Write Like This.
Private Sub Command1_Click()
Call Write_Registry
End Sub
===================
Private Sub Write_Registry()
On Error GoTo MyError
Dim MyKey As Variant
MyKey = "HKCU\Software\JRiver\Media Jukebox\Plugins\Interface\Your Program Name\"
CreateKey MyKey & "Check1(0)", Check1(0).Value
CreateKey MyKey & "Check1(1)", Check1(1).Value
CreateKey MyKey & "Check1(2)", Check1(2).Value
CreateKey MyKey & "Check1(3)", Check1(3).Value
CreateKey MyKey & "NumberFound", NewCount(0).Caption
CreateKey MyKey & "UserControl.BackColor", HScroll1.Value
MyError:
End Sub
Private Sub Read_Registry()
On Error Resume Next
Dim MyKey As Variant
MyKey = "HKCU\Software\JRiver\Media Jukebox\Plugins\Interface\Your Program Name\"
Check1(0) = ReadKey(MyKey & "Check1(0)")
Check1(1) = ReadKey(MyKey & "Check1(1)")
Check1(2) = ReadKey(MyKey & "Check1(2)")
Check1(3) = ReadKey(MyKey & "Check1(3)")
NewCount(0).Caption = ReadKey(MyKey & "NumberFound")
If NewCount(0).Caption = "" Then
NewCount(0).Caption = 0
End If
HScroll1.Value = ReadKey(MyKey & "UserControl.BackColor")
End Sub
=========================
If you Wish To Read The Registry When The User Starts The Plugin Then You Can Use This:
Private Sub UserControl_Initialize()
Call Read_Registry
End Sub
=========================
If you Wish To Write The Registry When The User Ends The Plugin Then You Can Use This:
Private Sub UserControl_Hide()
Call Write_Registry
End Sub
'Games People Play' Charted At 05 In 1975
Listening to: 'Games People Play' from 'The Best Of Spinners' by 'Spinners' on Media Center 9.1