AdvApi32RegLoadKey(SafeRegistryHandle, String, String) Method
Creates a subkey under
HKEY_USERS or
HKEY_LOCAL_MACHINE and loads the data from the
specified registry hive into that subkey.
Applications that back up or restore system state including system files and registry hives
should use the
Volume Shadow Copy service instead of the registry functions.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("AdvApi32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
public static Win32ErrorCode RegLoadKey(
SafeRegistryHandle hKey,
string subKey,
string file
)
<DllImportAttribute("AdvApi32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function RegLoadKey (
hKey As SafeRegistryHandle,
subKey As String,
file As String
) As Win32ErrorCode
Dim hKey As SafeRegistryHandle
Dim subKey As String
Dim file As String
Dim returnValue As Win32ErrorCode
returnValue = AdvApi32.RegLoadKey(hKey,
subKey, file)
public:
[DllImportAttribute(L"AdvApi32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static Win32ErrorCode RegLoadKey(
SafeRegistryHandle^ hKey,
String^ subKey,
String^ file
)
[<DllImportAttribute("AdvApi32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member RegLoadKey :
hKey : SafeRegistryHandle *
subKey : string *
file : string -> Win32ErrorCode
No code example is currently available or this language may not be supported.
- hKey SafeRegistryHandle
-
A handle to the key where the subkey will be created.
This can be a handle returned by a call to RegConnectRegistry function.
- subKey String
-
The name of the key to be created under hKey parameter.
This subkey is where the registration information from the file will be loaded.
Key names are not case sensitive.
- file String
-
The name of the file containing the registry data.
This file must be a local file that was created with the RegSaveKey function.
If this file does not exist, a file is created with the specified name.
Win32ErrorCode
If the function succeeds, the return value is
ERROR_SUCCESS.
If the function fails, the return value is other
Win32ErrorCode error code.
To get extended error information, call
GetLastWin32Error.