Does PowerBuilder have a baked in function to rename a registry key?
MS API has a RegRenameKey
https://learn.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regrenamekey
I am trying to create the external declaration for Powerbuilder to use but says to provide HKEY and string for the source target
LSTATUS RegRenameKey(
HKEY hKey,
LPCWSTR lpSubKeyName,
LPCWSTR lpNewKeyName
);
The PowerBuilder Declaration I came up with so far is:
FUNCTION ulong RegRenameKey(ulong hKey,ref string lpSubKeyName, ref string lpNewKeyName) LIBRARY "advapi32.dll"
My question is how exactly can I get the HKEY for HKEY_CURRENT_USER so I can do the following:
Rename:HKEY_CURRENT_USER\SOFTWARE\PackageName\1.0\KeyOne
to
HKEY_CURRENT_USER\SOFTWARE\PackageName\1.0\KeyTwo
without loosing any of the sub-keys and values in KeyOne
Frank