Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 17974
Number of posts: 55343

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
VB6: Accessing registry? Posted by jobromedia on 3 Oct 2005 at 3:35 AM
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?
Report
Re: VB6: Accessing registry? Posted by bmiller1222 on 3 Oct 2005 at 7:44 PM
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.
Report
Re: VB6: Accessing registry? Posted by jobromedia on 4 Oct 2005 at 4:56 AM
: 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.
Report
Re: VB6: Accessing registry? Posted by bmiller1222 on 19 Oct 2005 at 12:29 PM
: : 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.
Report
Re: VB6: Accessing registry? Posted by BitByBit_Thor on 19 Oct 2005 at 12:38 PM
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

Report
Re: VB6: Accessing registry? Posted by Psightoplazm on 22 Oct 2005 at 9:41 AM
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`~

Report
Re: VB6: Accessing registry? Posted by BitByBit_Thor on 22 Oct 2005 at 11:13 AM
: 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




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.