🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages Started by han Thu, 31 May 2007 14:33
copy and rename a registry key
#1899
Author: han
Date: Thu, 31 May 2007 14:33
4 lines
1475 bytes
I am trying to copy a registry key, rename it and then put back into the registry.  For example I have a key "Software\\XXXCompany\\Settings\\ViewForms\\16BitColorMode" in my registry, of course below that there are some keys. I would like to copy this key and all its subkey, and rename it to "Software\\XXXCompany\\Settings\\ViewForms\\32BitColorMode", the subkey is the same as before. I am able to use regsavekey to save the key to a hive file (see my previous post). But how can I make change to the key and then reload to the registry? I looked at RegReplaceKey. Lookes like it can not do what I would like to do. Any help? Thanks a lot.

han 
Re: copy and rename a registry key
#1900
Author: Bob Gonder
Date: Thu, 31 May 2007 15:35
8 lines
1770 bytes
han wrote:


>I am trying to copy a registry key, rename it and then put back into the registry.  For example I have a key "Software\\XXXCompany\\Settings\\ViewForms\\16BitColorMode" in my registry, of course below that there are some keys. I would like to copy this key and all its subkey, and rename it to "Software\\XXXCompany\\Settings\\ViewForms\\32BitColorMode", the subkey is the same as before. I am able to use regsavekey to save the key to a hive file (see my previous post). But how can I make change to the key and then reload to the registry? I looked at RegReplaceKey. Lookes like it can not do what I would like to do. Any help? Thanks a lot.

Perhaps TRegisty::MoveKey is what you want?

Otherwise, do it by hand with RegEnumKeyEx and RegQueryInfoKey 
Re: copy and rename a registry key
#1905
Author: Mike Collins
Date: Fri, 01 Jun 2007 14:02
11 lines
1384 bytes
Remember, if using MoveKey, you have to expilicity close the key before hand 
i.e. CloseKey() else the call will fail.


"Bob Gonder" <notbg@notmindspring.invalid> wrote in message 
news:rjpt53lk91d52llc1i8sujdbe1n7kd6gi9@4ax.com...
> han wrote:
>
>
>>I am trying to copy a registry key, rename it and then put back into the 
>>registry.  For example I have a key 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads