Hi, I'm creating a new key with this code:
Public Function CreateNewKey(sNewKeyName As String, lPredefinedKey As Long)
Dim hNewKey As Long 'handle to the new key
Dim lRetVal As Long 'result of the RegCreateKeyEx function
lRetVal = RegCreateKeyEx( _
lPredefinedKey, _
sNewKeyName, _
0&, _
vbNullString, _
REG_OPTION_NON_VOLATILE, _
KEY_ALL_ACCESS, _
0&, _
hNewKey, _
lRetVal _
)
RegCloseKey hNewKey
End Function
the caller is:
Temp = CreateNewKey("\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\ForceActiveDesktopOn", HKEY_CURRENT_USER)
But all I get in the root of HKEY_CURRENT_USER is a garbage key
Pls help
Public Function CreateNewKey(sNewKeyName As String, lPredefinedKey As Long)
Dim hNewKey As Long 'handle to the new key
Dim lRetVal As Long 'result of the RegCreateKeyEx function
lRetVal = RegCreateKeyEx( _
lPredefinedKey, _
sNewKeyName, _
0&, _
vbNullString, _
REG_OPTION_NON_VOLATILE, _
KEY_ALL_ACCESS, _
0&, _
hNewKey, _
lRetVal _
)
RegCloseKey hNewKey
End Function
the caller is:
Temp = CreateNewKey("\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\ForceActiveDesktopOn", HKEY_CURRENT_USER)
But all I get in the root of HKEY_CURRENT_USER is a garbage key
Pls help