CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2001
    Posts
    25

    write to registry

    hi all,

    below are the code that write something to the windows registry.
    My intension is to create a new entry under "HKEY_CURRENT_USER\SOFTWARE" with my program folder of MYTEST.
    but the code create a new entry under "HKEY_CURRENT_USER\Software\VB and VBA Program Settings". It seem like everthing u get or save is refer "HKEY_CURRENT_USER\Software\VB and VBA Program Settings" directory only.

    Am i use the correct function or passing the correct parameter to the function?
    thanks in advance!


    'mycode
    SaveSetting "HKEY_CURRENT_USER\SOFTWARE\MYTEST", "Startup", "Top", 75
    SaveSetting "HKEY_CURRENT_USER\SOFTWARE\MYTEST", "Startup", "Left", 50

    Debug.Print GetSetting("HKEY_CURRENT_USER\SOFTWARE\MYTEST", section:="Startup", _
    Key:="Left", Default:="25")


  2. #2
    Join Date
    Apr 2000
    Posts
    737

    Re: write to registry

    yap, using Savekey probably doesn't allow you to choose the location. If you need to choose location, you need to use API or alternatively check out http://vblib.virtualave.net, vbRegistry have wrapped the API into a useful class in the activeX DLL.



    HTH

    cksiow
    http://vblib.virtualave.net - share our codes

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