?
Solved

Windows Registry

Posted on 2001-08-31
4
Medium Priority
?
176 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 54

Expert Comment

by:Ryan Chong
ID: 6444173
0
 
LVL 1

Accepted Solution

by:
george74 earned 200 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

850 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