Information générale
Catégorie:
Fonctions Windows API
>>I need to be able to interactively set the thread priority of a FoxPro exe. Looking at the SetThreadPriority api call, I notice that I need a Thread handle. How do I get a thread handle of an already running process. Or if I call the exe with CreateProcess is the thread handle available to me there?
>>
>
>GetCurrentThread() returns a thread handle. CreateProcess() returns a thread handle to the first thread started in the Process it creates (as well as Process handle, process id and thread id) in the returned PROCESS_INFO structure. API_APPRUN parses this to get the process handle and thread handle in the ParseProcessInfoStruc method.
>
>Unless you understand the implications of altering thread and process priorities, I'd advise against changing them; the results can be far from optimal.
Thanks again, Ed. This is the first time I've actual have a use for the API_APPRUN file. < s >
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement