Jump to content
Excelsior Forums
atessier

Help needed with RegQueryValueEx

Recommended Posts

Hi Eveyone,

I'm trying to query a registry key value with xFunction.

The signature of the API call is as follow :

LONG RegQueryValueEx(

 HKEY hKey,

 LPCTSTR lpValueName,

 LPDWORD lpReserved,

 LPDWORD lpType,

 LPBYTE lpData,

 LPDWORD lpcbData

);

HKEY hkey, is an Handle to an Open key returned by the RegCreateKeyEx or RegOpenKeyEx function, or it

can be of one of predefined keys :

     HKEY_CLASSES_ROOT

     HKEY_LOCAL_MACHINE

     ...many others

Whatever example I find on the net puts one of the predefined keys as an argument for hkey. All

of the C example includes windows.h which must set the values. Other VB examples defines the

constant HKEY_LOCAL_MACHINE as being &H80000002.

The problem I have is how too pass this value (either HKEY_LOCAL_MACHINE or H8000002) as a parameter in xFunction ?

how do I transalate this predefine key for the first argument ?

CODE :

xFunction f=new xFunction("Advapi32", "int RegQueryValueExA(int, CSTRING, int, int*, CSTRING, int)");

Argument[] arg = new Argument[6];

arg[0] = new Argument(:huh:);

when I put the decimal equivalent of H80000002 which is 2147483650 it is out of range for an Integer.

Any help or working example of RegQueryValueEx integration in xFunction would be appreciated

Andr?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×