-
Registry
I want to modify the registry on another computer. Does anyone have an example how to use the API below:
Code:
Public Declare Function RegConnectRegistry Lib "advapi32.dll" Alias "RegConnectRegistryA" (ByVal lpMachineName As String, ByVal hKey As Long, phkResult As Long) As Long
Thanks,
TheBao
-
Code:
Enum cbRegSections
cbHKCurrentUser = HKEY_CURRENT_USER
cbHKLocalMachine = HKEY_LOCAL_MACHINE
cbHKClassesRoot = HKEY_CLASSES_ROOT
cbHKUsers = HKEY_USERS
cbHKPerformanceData = HKEY_PERFORMANCE_DATA
cbHKCurrentConfig = HKEY_CURRENT_CONFIG
cbHKDynData = HKEY_DYN_DATA
End Enum
Function ConnectRemote(ByVal CompName As String, ByVal regSection As cbRegSections) As Long
Dim retval As Long
Dim hKey As Long
retval = RegConnectRegistry(CompName, regSection, hKey)
ConnectRemote = hKey
End Function
:)