public static Boolean RegistryCopyKey(UIntPtr hKey_src, string SubKey, UIntPtr hKey_dst) { int Result = SafeNativeMethods.RegCopyTree(hKey_src, SubKey, hKey_dst); if (Result != 0) { Console.WriteLine("CopyKey error:{0}", LastError(Result)); return false; } return true; }