Click to See Complete Forum and Search --> : write to registry


taiew
July 18th, 2001, 04:15 AM
hi all,

below are the code that write something to the windows registry.
My intension is to create a new entry under "HKEY_CURRENT_USER\SOFTWARE" with my program folder of MYTEST.
but the code create a new entry under "HKEY_CURRENT_USER\Software\VB and VBA Program Settings". It seem like everthing u get or save is refer "HKEY_CURRENT_USER\Software\VB and VBA Program Settings" directory only.

Am i use the correct function or passing the correct parameter to the function?
thanks in advance!


'mycode
SaveSetting "HKEY_CURRENT_USER\SOFTWARE\MYTEST", "Startup", "Top", 75
SaveSetting "HKEY_CURRENT_USER\SOFTWARE\MYTEST", "Startup", "Left", 50

Debug.Print GetSetting("HKEY_CURRENT_USER\SOFTWARE\MYTEST", section:="Startup", _
Key:="Left", Default:="25")

cksiow
July 18th, 2001, 04:25 AM
yap, using Savekey probably doesn't allow you to choose the location. If you need to choose location, you need to use API or alternatively check out http://vblib.virtualave.net, vbRegistry have wrapped the API into a useful class in the activeX DLL.



HTH

cksiow
http://vblib.virtualave.net - share our codes