VB6: Accessing registry?

Hi!

What I wanna do:

Access a specific key in the registry, read the value and update it with a new one.

How do I go about that?

Comments

  • May I ask what is wrong with the registry editor? And are you sure you want to edit it? If you do edit it, MAKE A BACKUP FIRST, trust me I have run into many problems playing with it in the past.
  • : May I ask what is wrong with the registry editor? And are you sure you want to edit it? If you do edit it, MAKE A BACKUP FIRST, trust me I have run into many problems playing with it in the past.
    :
    My intrests are not to edit the registry editor. I have some software that needs accesing certin parts of the registry designed by me, that's why I wonder this question.
  • : : May I ask what is wrong with the registry editor? And are you sure you want to edit it? If you do edit it, MAKE A BACKUP FIRST, trust me I have run into many problems playing with it in the past.
    : :
    : My intrests are not to edit the registry editor. I have some software that needs accesing certin parts of the registry designed by me, that's why I wonder this question.
    :
    There are some functions you can use to access it to read and write values, but my computer with all my programming stuff is broke right now so I cannot help out much, sorry. Anyways though I know I have seen and used these functions before, and I believe I needed to add a reference, but I cannot recall which it was. Anyways check out the microsoft site, they will have something on it for sure. I know it can be a pain to navigate through it but just check it out.
  • Use the Windows API's for registry editing. But I warn you, they are not very programmer friendly. The way to use API's is different from using VB's functions.

    The names of the API's you are looking for are amoung others: RegOpenKey(Ex), RegCreateKey(Ex), RegSetValueEx, RegEnumValue, RegEnumKeyEx, RegDeleteValue, RegDeleteKey, RegCloseKey. Those are the primary ones.
    I could write a paper on how to use them all, so I suggest you look up examples of how to use these on the web.

    The basic order is:
    Open key --> You receive a key handle
    Do any modifications you like (using the key handle)
    Close key (handle)

    Greets...
    Richard

  • If it's just simple access you need to the registry (aka, write/access your OWN key) then you can use the regtools5 addin that comes with your VB6 package. Using this reference will require your program to have an installer in order to function on other computers, or you can simply include the regtool DLL. This will give you straight forward access to basic registry editing functions with no API interface or confusion.

    ><//~Psightoplasm`~

  • : If it's just simple access you need to the registry (aka, write/access your OWN key) then you can use the regtools5 addin that comes with your VB6 package. Using this reference will require your program to have an installer in order to function on other computers, or you can simply include the regtool DLL. This will give you straight forward access to basic registry editing functions with no API interface or confusion.
    :
    : ><//~Psightoplasm`~
    :
    :

    I personally rather take the difficulty of the API's then having to add ANOTHER DLL file to my project... But it is easier, definitely.

    Greets...
    Richard

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories