Solved

Windows Registry

Posted on 2001-08-31
4
164 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
4 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
Comment Utility
0
 
LVL 1

Accepted Solution

by:
george74 earned 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks a bunch George!!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now