473,387 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

RegCreateKeyEx functionality, specify class(object type) of a key, with .NET?

The RegCreateKeyEx() API provides a parameter to specify the
class(object type) of the a key. (lpClass in the definition below)

LONG RegCreateKeyEx(
HKEY hKey,
LPCTSTR lpSubKey,
DWORD Reserved,
LPTSTR lpClass,
DWORD dwOptions,
REGSAM samDesired,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
PHKEY phkResult,
LPDWORD lpdwDisposition
)

The RegistryKey class in the .NET framework do not provide this
functionality.
How do I do this in .NET?
Nov 22 '05 #1
3 3104
Truth. I've never seen someone use that parameter and don't even know
what it does.

Solution. You could write a interop function that calls the
RegCreateKeyEx Win32 API directory.

Hope this helps,

Randy
http://www.kbcafe.com

sa***@hotmail.com (Saby) wrote in message news:<84**************************@posting.google. com>...
The RegCreateKeyEx() API provides a parameter to specify the
class(object type) of the a key. (lpClass in the definition below)

LONG RegCreateKeyEx(
HKEY hKey,
LPCTSTR lpSubKey,
DWORD Reserved,
LPTSTR lpClass,
DWORD dwOptions,
REGSAM samDesired,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
PHKEY phkResult,
LPDWORD lpdwDisposition
)

The RegistryKey class in the .NET framework do not provide this
functionality.
How do I do this in .NET?

Nov 22 '05 #2
Truth. I've never seen someone use that parameter and don't even know
what it does.

Solution. You could write a interop function that calls the
RegCreateKeyEx Win32 API directory.

Hope this helps,

Randy
http://www.kbcafe.com

sa***@hotmail.com (Saby) wrote in message news:<84**************************@posting.google. com>...
The RegCreateKeyEx() API provides a parameter to specify the
class(object type) of the a key. (lpClass in the definition below)

LONG RegCreateKeyEx(
HKEY hKey,
LPCTSTR lpSubKey,
DWORD Reserved,
LPTSTR lpClass,
DWORD dwOptions,
REGSAM samDesired,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
PHKEY phkResult,
LPDWORD lpdwDisposition
)

The RegistryKey class in the .NET framework do not provide this
functionality.
How do I do this in .NET?

Nov 22 '05 #3
Thanks.
I used the following... Works great.

[DllImport("advapi32.dll")]
public static extern int RegCreateKeyEx(
uint hKey,
string lpSubKey,
int Reserved,
string lpClass,
int dwOptions,
int samDesired,
ref int lpSecurityAttributes,
ref uint phkResult,
ref int lpdwDisposition
);

uint hKey = 0;
int disp = 0;
int reserved = 0;
int ret = 0;
uint root = 0x80000002; //HKLM
ret = SomeClass.RegCreateKeyEx(root, "SOFTWARE\\test1", 0,
"Parameter", 0,0,ref reserved, ref hKey, ref disp);

rm****@kbcafe.com (Randy Charles Morin) wrote in message news:<a4*************************@posting.google.c om>...
Truth. I've never seen someone use that parameter and don't even know
what it does.

Solution. You could write a interop function that calls the
RegCreateKeyEx Win32 API directory.

Hope this helps,

Randy
http://www.kbcafe.com

Nov 22 '05 #4

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

Similar topics

2
by: Krzysztof Stachlewski | last post by:
I tried to run the following piece of code: Python 2.3.4 (#53, May 25 2004, 21:17:02) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> o = object() >>> o.a...
106
by: A | last post by:
Hi, I have always been taught to use an inialization list for initialising data members of a class. I realize that initialsizing primitives and pointers use an inialization list is exactly the...
2
by: Saby | last post by:
The RegCreateKeyEx() API provides a parameter to specify the class(object type) of the a key. (lpClass in the definition below) LONG RegCreateKeyEx( HKEY hKey, LPCTSTR lpSubKey, DWORD...
9
by: justanotherguy63 | last post by:
Hi, I am designing an application where to preserve the hierachy and for code substitability, I need to pass an array of derived class object in place of an array of base class object. Since I...
1
by: ypjofficial | last post by:
Dear All, According to OOPs , a base class pointer can to point to derived class object....call this as fact1 But somehow I am not comfortable while understanding this concept. The explanaition...
6
by: Brad | last post by:
I am creating a class (not a control) which implements IStateManager. I've created the class and all of the implementations (LoadView, SaveViewState, etc...). My Question is: How do I...
3
by: Tony Johansson | last post by:
Hello!! You may correct me if I have made any wrong assumptions. Below I have some simple classes. When you have this t.ToString() below it's the ToString() method in Object class that is...
13
by: docschnipp | last post by:
Hi, I have a bunch of object derived from the same base class. They all share the same constructor with some parameters. Now, instead of using a large switch() statement where I call every...
1
by: archana | last post by:
Hi all, I am confuse in concept of inheritance. I am having following 2 classes class base1 { public void abc() { System.Console.WriteLine("base1 abc"); }
13
by: Rahul | last post by:
Hi Everyone, I was just playing around virtual functions and landed up with the following, class Base1 { public: virtual void sample() { printf("base::sample\n");
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.