devxlogo

Storing Values in a Windows Registry with VB

Storing Values in a Windows Registry with VB

The following code allows you to permanently store values in a Windows registry and retrieve them later:

SaveSetting appname:="ABCX", Section:="Startup", Key:="samp", setting:="Y"

You can either check in the Windows registry (search for key ABCX) or you can directly visit:

 HKEY_CURRENT_USER/Software/VB and VBA Program Settings/ABCX/Startup(Windows 98 )

Retrive the key value using the following code:

sampkey = GetSetting(appname:="ABCX", Section:="Startup", Key:="samp")

Delete the key using this code:

DeleteSetting appname:="ABCX", Section:="Startup, Key:="samp"

devx-admin

Share the Post: