Nothing to fear. It is relatively easy to both read from and write to the
registry, if you have permissions. Here's some code to read a value:
QueryRegistryKeyValue
Private Declare Function RegOpenKeyEx Lib "advapi32.dll" _
Alias "RegOpenKeyExA" (ByVal hKey As Long, _
ByVal lpSubKey As String, ByVal ulOptions As Long, _
ByVal samDesired As Long, ByRef phkResult As Long) _
As Long
' the values for lPredefinedKey
Public Const HKEY_CLASSES_ROOT = &H80000000
Public Const HKEY_CURRENT_USER = &H80000001
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const HKEY_USERS = &H80000003
Public Const HKEY_PERFORMANCE_DATA = &H80000004
Public Const HKEY_CURRENT_CONFIG = &H80000005
Public Const HKEY_DYN_DATA = &H80000006
Public Function QueryRegistryKeyValue(sKeyName As String, sValueName As
String, _
lPredefinedKey As Long) 'QueryValue "TestKey\SubKey1", "StringValue"
,HKEY_CURRENT_USER
Dim lRetVal As Long 'result of the API functions
Dim hKey As Long 'handle of opened key
Dim vValue As Variant 'setting of queried value
lRetVal = RegOpenKeyEx(lPredefinedKey, sKeyName, 0, _
KEY_READ, hKey)
lRetVal = QueryValueEx(hKey, sValueName, vValue)
QueryRegistryKeyValue = vValue
RegCloseKey (hKey)
End Function
I think Albert Kallal wrote some code to change printers that involved
reading and writing to the registry. You might hunt it down on his website.
See:
http://bytes.com/forum/thread492661.html