Solved

Windows Registry

Posted on 2001-08-31
4
166 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 50

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

810 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