CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2000
    Location
    Denham Springs, LA
    Posts
    15

    Write to Registry

    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

  2. #2
    Guest

    Re: Write to Registry

    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


  3. #3
    Join Date
    Jul 2001
    Location
    Romania
    Posts
    52

    Re: Write to Registry

    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:[email protected]
    bye
    It is the weak who are cruel,
    only the strong can be truly gentle!
    Szilard

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured