Solved

Windows Registry

Posted on 2001-08-31
4
170 Views
Last Modified: 2012-06-27
Hi!

Can anyone show me the steps required to write data into the Windows Registry??

As my application requires to save some settings

Thanks
0
Comment
Question by:viperfoo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 6444173
0
 
LVL 1

Accepted Solution

by:
george74 earned 50 total points
ID: 6444313
Hi,

for basic registry manipulation (if you just want to store and retrieve values in a basic way) use the following statements/functions:

GetSetting(appname, section, key[, default])
GetAllSettings( appname, section )
SaveSetting appname, section, key, setting
DeleteSetting appname, section[, key]

Note, these functions will operate on keys under HKEY_CURRENT_USER\Software\VB and VBA Program Settings\[appname].

If you want that your settings reside directly under software, or absolutely in another part of the registry, you must define and use in your VB code some of the following Win32API functions (according to your needs):
 
RegCloseKey  
RegConnectRegistry  
RegCreateKey  
RegCreateKeyEx  
RegDeleteKey  
RegDeleteValue  
RegEnumKey  
RegEnumKeyEx  
RegEnumValue  
RegFlushKey  
RegGetKeySecurity  
RegLoadKey  
RegNotifyChangeKeyValue  
RegOpenKey  
RegOpenKeyEx  
RegQueryInfoKey  
RegQueryMultipleValues  
RegQueryValue  
RegQueryValueEx  
RegReplaceKey  
RegRestoreKey  
RegSaveKey  
RegSetKeySecurity  
RegSetValue  
RegSetValueEx  
RegUnLoadKey

For more information, consult the following link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconmanagingapplicationsettings.asp

Please note that GetSetting and SaveSetting are not available if you are developing WebClass application.

Cheers
0
 
LVL 1

Expert Comment

by:DandL
ID: 6448284
george74 welcome to EE.  You seem to know your stuff and that means you will be a
great addition to this EE community.  I would like to point you to one link.
http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp  When you go there scroll all
the way to the bottom and check out the section on

* Advice for Experts on Providing Solutions Through Comments or Answers *


* Often, an Expert posts the solution to your problem as a comment because it is early in
the collaboration process and other issues may be involved. In addition, it is common
etiquette in some topics areas to always post comments and not answers.  *
You will notice by reading peoples profiles that those who have been here longer than a
few weeks will only lock a question if it has been open for several days and they know the
comment they gave answered the question.....even then a lot of us don?t lock questions.
That way we know we have really answered the question when the question *asker*
chooses our comment as the answer to their question.

DandL
0
 
LVL 2

Author Comment

by:viperfoo
ID: 6449490
Thanks a bunch George!!
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question