Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting Thread Priorities
Message
From
05/05/2000 17:31:24
 
 
To
05/05/2000 17:10:34
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00366808
Message ID:
00366825
Views:
13
>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.
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform