- Frank Zettanucci
- PowerBuilder
- Tuesday, 14 March 2023 08:52 PM UTC
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
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.