Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find Files
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00765698
Message ID:
00765884
Vues:
15
>I need to locate the WinZip dir if it exists. Which API is used for a file search?

One way to do this by looking in the registry for the location of WinZip32.exe, like this:
#DEFINE HKEY_LOCAL_MACHINE          -2147483646  && BITSET(0,31)+2
* lcWinZipKey is the expected location of the registry key
lcWinZipKey = "Software\Microsoft\Windows\CurrentVersion\app paths\winzip32.exe" && In the HKLM hive.
LOCAL oReg, lcValue, lnErrorCode
oReg = NewObject( "Registry", HOME(1) + "FFC\Registry.VCX")
IF oReg.IsKey( lcWinZipKey, HKEY_LOCAL_MACHINE)
   lcValue = ""
   lnErrorCode = oReg.GetRegKey( "", @lcValue, lcWinZipKey, HKEY_LOCAL_MACHINE)
   RETURN IIF( lnErrorCode = 0, lcValue, NULL)
ELSE
   RETURN NULL
ENDIF
-Rick
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform