Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HProcess?
Message
De
05/05/2000 23:36:31
 
 
À
05/05/2000 19:07:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00366864
Message ID:
00366912
Vues:
19
>How can I get the hProcess of a FoxPro running exe?
>

If you're talking about the current execution context, GetCurrentProcess() should work - otherwise, you have to search the set of running processes to find the ProcessID and use OpenProcess() to retrieve a handle with the needed privileges.

>I need the program to reset its own priority.
>

If you do not understand the consequences and mechanisms of adjusting the priority of a process you are exceedingly likely to hurt yourself. I'll lay very heavy odds that since you don't know about GetCurrentProcess() you are odds on to mangle Windows a few times. Do yourself a favor; try launching the unzip process via CreateProcess() and use the dwCreationFlags value to adjust the priority when you start the process - see the MSDN Library entry on CreateProcess, and look in detail at the dwCreationFlags parameter values for the MSDN Library entry on CreateProcess(). Let the parent process set it.

>Background - we have several processes running on a Web Server.
>One of them unzips new files as they are uploaded
>- it kinda brings the machine to its knees
>- so we would like to set it to a low priority.
>
>Thanks,
>Dan
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform