Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetWindowsDirectory
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00291459
Message ID:
00291469
Vues:
20
>>>>There is little I can find on this WIN32API function as it pertains to anything other than C++. Any thoughts as to its arguments or an alternative means to achieving the same result? The aim is to get the "windows" directory.Thank you in advance.
>>>
>>>There's an entry in the FAQ that I wrote, FAQ#7806, that gives an exact implementation of this in VFP. It's under Win32 and Other APIs
>>
>>And there's also GETENV('WINDIR'). However, I don't know if it's reliable under NT.
>
>GETENV() works, but IMO is not the preferred method to use, since the environment variable can be changed by batch files or scripts. It's particularly suspect when issued from a spawned process, where the parent process may have mucked with the environment inherited by the child.

I agree (as you might expect). The only thing I'd say is that any process (outside of Windows) that fools with this environment variable should be immediately relegated to the "bit-bucket". There are a lot of "ill-behaved" programs out there, but this would take that phrase to a different level of meaning< g >.
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