473,785 Members | 2,321 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RegistryKey -> IntPtr

Hi there anyone know to the get the native registry Handle from a RegistryKey?

thanks in advance
Nov 17 '05 #1
1 3383
public static IntPtr GetRegistryHand le(RegistryKey registryKey)
{
Type type = registryKey.Get Type();
FieldInfo fieldInfo = type.GetField(" hkey", BindingFlags.In stance |
BindingFlags.No nPublic);
return (IntPtr)fieldIn fo.GetValue(reg istryKey);
}
Brian Keating wrote:
Hi there anyone know to the get the native registry Handle from a RegistryKey?

thanks in advance

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4092
by: geek_in_a_box | last post by:
I seem to be experiencing a behavior on Framework 1.0 sp2 RegistryKey class where the class is not releasing/closing named pipe winreg handles to remote machines. The process continues to hold on to a handle to the following pipe: \Device\LanmanRedirector\<MACHINE>\PIPE\winreg Even after explicitly calling Close() (which, according to the docs, should not matter for a base key), and expliticly doing garbage collections, I cannot seem...
2
2517
by: =JT= | last post by:
I would like to get the HKEY(a handle to the registry key) from the RegistryKey class in C#, but it does not seem to be exposed. is it possible?
1
4486
by: R Agam | last post by:
Hi How can I tell what type of value (string, int, ...) is returned from a call to RegistryKey.GetValue? Thanks, Ronen
7
14833
by: Bob | last post by:
I'm working on a Windows app that needs to write to the Registry HKLM. I keep getting a "System.UnauthorizedAccessException: Cannot write to the registry key." error when running the app. I'm logged in as an Administrator and it's a Windows app. What permission does it need? Here's the code. private void ChangeReg() { string regPath = "SOFTWARE\\Microsoft\\.NETFramework\\AssemblyFolders"; RegistryKey thisKey = Registry.LocalMachine;
0
2854
by: csharp_helpwanted | last post by:
steps.. first, I'm creating a connection by mapping a network drive to the pc second, the map drive connection was successful I try to read a certian registry key/value (that is a valid reg item) third, I disconnect the network drive connection it works great the first time but if i run it again on the same pc anytime after that I get the following
0
3267
by: g82martin | last post by:
I am using the RegistryKey class to access the registry on remote machines. I only require read access. I am able to successfully read registry keys under HKLM\Software\Microsoft\Windows NT\CurrentVersion\HotFix but I get a permissions error when I try to access HKLM\Software\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx. The security permissions are identical on these two keys. Here is my code: RegistryKey...
5
4673
by: Steve Bottoms | last post by:
Hi, all... Trying to determine how to check the state of OpenSubKey when called. What is the return value if the requested subkey doesn't exist?? I try a GetType on the result but only get a bizarre error, so I'm uncertain what should be returned on both success or failure! Thanks! Jack
2
3594
by: auldh | last post by:
being a novice i searched the net to get help on my c# project. i'm trying to iterate, enumerate, loop through a registry tree hive. for example i have a sub folder under HKLM\SOFTWARE that has some 21 sub folders and there are sub folders under some of he 21. i have no problem going into the sub folder (lets call it) programX. when i do an readkeys.opensubkey(regipath) and then keyvalue.getvalue(...) it will not only read the "values"...
3
1417
by: marcussilfver | last post by:
How can I set write permissions for a limited user to write values to a certain registrykey. This registrykey is also written to by a administrator (which probably also created the key in the first place). I have looked at the RegistryPermission class but would really like to see a code sample on this. How can it be done, simplest way possible? thanx
2
5268
by: =?Utf-8?B?RGF2aWQgSw==?= | last post by:
I have some C# code I am using to delete a subkey and its tree from the registry however I am running into some issues. At first, I was using the Registry.LocalMachine.DeleteSubKeyTree method and passing it a string like this: SubKeyBase = @"SYSTEM\CurrentControlSet\Enum\"; Registry.LocalMachine.DeleteSubKeyTree(SubKeyBase + InstanceID); The variable InstanceID had something like this in it:
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.