AdvApi32RegRenameKey(IntPtr, String, String) Method
Renames a registry subkey.
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 RegRenameKey(
IntPtr hKey,
string srcSubKeyPathOrName,
string dstSubkeyName
)
<DllImportAttribute("AdvApi32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function RegRenameKey (
hKey As IntPtr,
srcSubKeyPathOrName As String,
dstSubkeyName As String
) As Win32ErrorCode
Dim hKey As IntPtr
Dim srcSubKeyPathOrName As String
Dim dstSubkeyName As String
Dim returnValue As Win32ErrorCode
returnValue = AdvApi32.RegRenameKey(hKey,
srcSubKeyPathOrName, dstSubkeyName)
public:
[DllImportAttribute(L"AdvApi32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static Win32ErrorCode RegRenameKey(
IntPtr hKey,
String^ srcSubKeyPathOrName,
String^ dstSubkeyName
)
[<DllImportAttribute("AdvApi32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member RegRenameKey :
hKey : IntPtr *
srcSubKeyPathOrName : string *
dstSubkeyName : string -> Win32ErrorCode
No code example is currently available or this language may not be supported.
- hKey IntPtr
-
A handle to the source registry rootkey or subkey.
- srcSubKeyPathOrName String
-
The relative path or the name of the source subkey. (eg. "SOFTWARE\My Old SubKey" or "My Old SubKey")
- dstSubkeyName String
-
The destination name of the subkey. (eg. "My New SubKey")
Win32ErrorCode
Returns
0 (zero) if successful; otherwise, a Win32 system error code.
This is a code example.
No code example is currently available or this language may not be supported.
Using regKey As RegistryKey =
RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64).
OpenSubKey("SOFTWARE", RegistryKeyPermissionCheck.ReadWriteSubTree)
Dim result As Integer = NativeMethods.RegRenameKey(regKey.Handle, "Old SubKey Name", "New SubKey Name")
If (result <> 0) Then
Throw New Win32Exception(result)
End If
End Using
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.