Quantster
asked on
How to check if a Registry key exists in VB6.0
I want to check if a registry key exists in VB6.0. How do I do that.
Thanks
Quantster
Thanks
Quantster
If you just want to check if it exists, use GetSetting()
Thats probably misleading.... This function will only check the portion of the registry used by VB applications. If you need to get access to another area, the RegistryObject is your friend.
Thats probably misleading.... This function will only check the portion of the registry used by VB applications. If you need to get access to another area, the RegistryObject is your friend.
ASKER
Actually I want to use the API. Thats what I was looking for. Let me give this a try.
Back in the day, I used one created by TheScarms. The site is really chock full of API tricks, which I'm sure you'll like!
http://www.thescarms.com/VBasic/registry.aspx
http://www.thescarms.com/VBasic/registry.aspx
ASKER
I am kind of having difficulty doing this. GetSetting seems to retrive Keys only from the user specific portion (HKEY_CURRENT_USER). My key is located in the HKEY_LOCAL_MACHINE? I am little confused. Do you guys have some sample source code.
Thanks
Quantster
Thanks
Quantster
The GetSetting method does not use the API, that is what I was trying to clarify above. To use the Windows API to manipulate the registry, check this out:
http://support.microsoft.c om/kb/1456 79
The registry object that I posted above encapsulates these API calls into a more user friendly control. Either will get the job done, though.
http://support.microsoft.c
The registry object that I posted above encapsulates these API calls into a more user friendly control. Either will get the job done, though.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://msdn.microsoft.com/
You can also download and use the RegistryObject from MS that allows you to interact with the registry pretty easily without the using API:
http://download.microsoft.