?
Solved

Windows Registry

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

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

Independent Software Vendors: 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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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…
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

771 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