• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1302
  • Last Modified:

Retrieve from Registry... VB6.0

How do you get all the registry values at one go and display them in a combo box?

i first store the values in the registry at the start of my program but in some parts of the program i would like to retrieve the values and display them in a combo box...
1 Solution
Mayank SAssociate Director - Product EngineeringCommented:
See the code for the pre-defined About Dialog in VB.

Could use combination of getsetting, GetAllSettings ,SaveSetting

GetSetting(appname, section, key[, default])

The GetSetting function syntax has these named arguments:

appname - String expression containing the name of the application or project whose key setting is requested.

section - String expression containing the name of the section where the key setting is found.

key -  String expression containing the name of the key setting to return

default (Optional) - Expression containing the value to return if no value is set in the key setting. If omitted, default is assumed to be a zero-length string ("").


txtPayment.Text = GetSetting(App.EXEName, "Print_Settings", "Payment", "600")

The App object is a global object accessed with the App keyword. It determines or specifies information about the application's title, version information, the path and name of its executable file and Help files, and whether or not a previous instance of the application is running.

EXEName Property  

Returns the root name of the executable file (without the extension) that is currently running. If running in the development environment, returns the name of the project.

Hope this helps you in the right direction

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, ByRef lpType As Long, ByVal szData As String, ByRef lpcbData As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal lpData As Any, ByVal cbData As Long) As Long         ' Note that if you declare the lpData parameter as String, you must pass it By Value.

API calls in windows
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.
My recommandation: answered by dhaest
can't say I agree you answered his question but then I did not check your links!


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now