?
Solved

Visual Basic programming

Posted on 2003-03-06
9
Medium Priority
?
169 Views
Last Modified: 2013-11-25
Is there any way how to write settings in registry, but in other places, not in the " vb and vba programms" group?
0
Comment
Question by:njam_njam
[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
9 Comments
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 8086298
Grab some useful examples at:
http://www.vbcode.com/asp/code.asp?lstCategory=Registry

cheers
0
 

Author Comment

by:njam_njam
ID: 8086346
Thanks, man! I'll try it as soon I'll get back home.
0
 

Expert Comment

by:cocomobasic
ID: 8086572
yes you can, but u need to know Win32 APIs;
try researching on the APIs:

RegCreateKeyEx
RegOpenKeyEx
RegSetValueEx
RegQueryValueEx
RegDeleteKey
RegCloseKey

with these functions, you could create you own registry keys, delete them, query a value, and set a value at your desired location..

the only problem is it takes time to learn them since there are STRUCTURES involved and there are lots of things to watch out for.... but i know you can do it

also, try this site

http://ltpb.8m.com/tutorial/Registry.html
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 6

Accepted Solution

by:
marconovaro earned 200 total points
ID: 8087041

Here is a nice class:

http://www.vbaccelerator.com/home/VB/Code/Libraries/Registry_and_Ini_Files/Complete_Registry_Control/article.asp

that will do the "dirty" job for you. You'll have a nicer and easier "object oriented" interface.
HTH
M
0
 

Expert Comment

by:yoann_prout
ID: 8087652
To your visual basic project add as reference the OCX wshom.ocx, then for example you can try this :
__________________________________________________________

Option Explicit

Private Sub Command1_Click()
    Dim WshSReg As New WshShell

    WshSReg.RegWrite "HKCU\Software\ACME\FortuneTeller\", 1, "REG_BINARY"
    WshSReg.RegWrite "HKCU\Software\ACME\FortuneTeller\MindReader", "Goocher!", "REG_SZ"
   
    MsgBox WshSReg.RegRead("HKCU\Software\ACME\FortuneTeller\MindReader")
   
    WshSReg.RegDelete "HKCU\Software\ACME\FortuneTeller\MindReader"
    WshSReg.RegDelete "HKCU\Software\ACME\FortuneTeller\"
    WshSReg.RegDelete "HKCU\Software\ACME\"
End Sub

__________________________________________________________

For more infos, just take a look here :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsMthRegWrite.asp
0
 

Expert Comment

by:snowbordingexe
ID: 8103725
Try this

SaveSetting(ProgramName as string, FolderName as string, Keyname as string, Value as string)

To read
GetSetting(ProgramName as string, Foldername as string, Keyname as string)

Example

Private sub cmdSaveReg_Click()
   dim a
   a = inputbox("Enter a string")
   savesetting "Test Program", "Settings", "String" _
      , a
end sub

Private sub cmdReadReg_Click()
   dim a as string
   a = getsetting("Test Program", "Settings", "String")
   msgbox a
end sub

This should solve your problem
These functions are all part of visual basic 6.0

Hope this Works.

Aaron.

0
 

Author Comment

by:njam_njam
ID: 8127629
Thank you !
0
 

Expert Comment

by:CleanupPing
ID: 8900541
njam_njam:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
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 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…
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…
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…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

762 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