G Guest Apr 19, 2005 #1 Hi there anyone know to the get the native registry Handle from a RegistryKey? thanks in advance
S Shortgrey Apr 19, 2005 #2 public static IntPtr GetRegistryHandle(RegistryKey registryKey) { Type type = registryKey.GetType(); FieldInfo fieldInfo = type.GetField("hkey", BindingFlags.Instance | BindingFlags.NonPublic); return (IntPtr)fieldInfo.GetValue(registryKey); }
public static IntPtr GetRegistryHandle(RegistryKey registryKey) { Type type = registryKey.GetType(); FieldInfo fieldInfo = type.GetField("hkey", BindingFlags.Instance | BindingFlags.NonPublic); return (IntPtr)fieldInfo.GetValue(registryKey); }