Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RegOpenKeyEx parameters
Message
 
À
14/06/2000 20:33:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00380521
Message ID:
00380663
Vues:
12
>I need to know how to get the starting handle number list for the Win32Api function RegOpenKeyEx. I am trying to look at HKEY_LOCAL_MACHINE ..... and need the first parameter. I have an example I am using from Nigel Cotes mapi component but I am attempting to adapt this part of it to detect the existance of a particular PDF printer.
>
>RegOpenKeyEx(-2147483647, "Software\Microsoft\Windows Messaging Subsystem\Profiles", 0, 0, @lnHandle)
>
>The first parameter above is a number and I don't know what this is or how to modify it for my use to get to
>
>HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\Print\Printers\DocuCom PDF Driver
>
>
>Where do I find help on WIN32API for these parameters. I tried the API section but could not find anything (probably because I have not learned to use it properly yet).
>
>Thanks in advance
>
Terry,

Look at the Registry class that ships with VFP. It comes with a header file (registry.h) that contains the constants. Here are the constants for the root keys.
#DEFINE HKEY_CLASSES_ROOT           -2147483648  && BITSET(0,31)
#DEFINE HKEY_CURRENT_USER           -2147483647  && BITSET(0,31) + 1
#DEFINE HKEY_LOCAL_MACHINE          -2147483646  && BITSET(0,31) + 2
#DEFINE HKEY_USERS                  -2147483645  && BITSET(0,31) + 3
* Your example:
lnerr = RegOpenKeyEx(HKEY_LOCAL_MACHINE,;
  "System\CurrentControlSet\control\Print\Printers\DocuCom PDF Driver",;
  0, 0, @lnhandle)
The value returned in lhandle, provided lnerr equals ERROR_SUCCESS (0), is used to access the individual registry entries.

The MSDN library contains all the Platform SDK which documents the API calls.

Look closely at the registry class that ships with VFP. It can make this task a lot easier for you.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform