Click to See Complete Forum and Search --> : Write to Registry


nekozboy
July 18th, 2000, 09:05 PM
Can someone tell me a easy way to write this to the registry (Please remember im new to vb)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Network\LanMan\mail]
"Flags"=dword:00000192
"Type"=dword:00000000
"Path"="C:\\yourfoldername"
"Parm2enc"=hex:
"Parm1enc"=hex:
"Remark"="Your comments."

http://www.lanmailman.8m.com

July 18th, 2000, 10:27 PM
This article may be useful for your case.
Go to www.planet-source-code.com.
Choose Visual Basic\Registry.
You should see list of available code. One of them is cReadWriteEasyReg(Updated Again) by Riaan Aspelling. I think it can solve your problem.

oneshadow

vszilard
July 19th, 2001, 04:23 AM
Read and Write to the Registry

'REGISTRY.CLS
Option Explicit

Private msAppname As String
Private msSection As String
Private msKey As String
Private msSetting As String

'~~~AppName
Public Property Get Appname() As String
Appname = msAppname
End Property
Public Property Let Appname(ByVal sAppName As String)
msAppname = sAppName
End Property

'~~~Section
Public Property Get Section() As String
Section = msSection
End Property
Public Property Let Section(ByVal sSection As String)
msSection = sSection
End Property

'~~~Key
Public Property Get Key() As String
Key = msKey
End Property
Public Property Let Key(ByVal sKey As String)
msKey = sKey
End Property

'~~~Setting
Public Property Get Setting() As String
Setting = msSetting
End Property
Public Property Let Setting(ByVal sSetting As String)
msSetting = sSetting
End Property

'~~~RegGet
Public Sub RegGet()
msSetting = GetSetting(msAppname, msSection, msKey)
End Sub

'~~~RegSave
Public Sub RegSave()
SaveSetting msAppname, msSection, msKey, msSetting
End Sub

'~~~RegDel
Public Sub RegDel()
DeleteSetting msAppname, msSection, msKey
End Sub




Using Registry Class

Option Explicit

Dim regTest As New Registry

Private Sub cmdSave_Click()
regTest.Key = txtKey.Text
regTest.Setting = txtSetting.Text
regTest.RegSave
End Sub

Private Sub cmdGet_Click()
regTest.Key = txtKey.Text
regTest.RegGet
txtSetting.Text = regTest.Setting
End Sub

Private Sub cmdDel_Click()
regTest.Key = txtKey.Text
regTest.RegDel
End Sub

Private Sub Form_Load()
regTest.Appname = App.Title
regTest.Section = "Testing"
End Sub





Associate a File Type with an Application
Always backup your Registry before making modifications
Sample MYAPP.REG

REGEDIT4

[HKEY_CLASSES_ROOT\.mya]
"Content Type"="VBRegSample"
@="MyApp"

[HKEY_CLASSES_ROOT\.mya\ShellNew]
"NullFile"=""

[HKEY_CLASSES_ROOT\MyApp]
@="My File"

[HKEY_CLASSES_ROOT\MyApp\DefaultIcon]
@="c:\\Samples\\MyApp.EXE,0"

[HKEY_CLASSES_ROOT\MyApp\shell]

[HKEY_CLASSES_ROOT\MyApp\shell\open]

[HKEY_CLASSES_ROOT\MyApp\shell\open\command]
@="c:\\Samples\\MyApp.EXE %1"




Retrieving Command Line Arguments

Dim mstrFile As String

Private Sub Form_Load()
'Get command line argument
mstrFile = Command()
'If there was an argument, do something
If Len(mstrFile) Then
OpenFile 'Or take other action
End If
End Sub




Hello, Szilard wish you the best.
You can mail me at:darkertemplar@hotmail.com
bye