Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to minimize window and set low priority through API?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00527416
Message ID:
00528222
Views:
28
>Thanks Larry, I got it working now!

Your welcome. I'm happy you got it working!

>
>Sure, I mix thread, process and other IDs and handles up, since I am doing this API stuff just for the second time, and in this particular case one of the functions is even called GetWindowThreadProcessId() :)))

Those MS guys and their naming conventions < bg >.

>
>Do I get it right, that if I set SetPriorityClass(lnhproc,IDLE_PRIORITY_CLASS) and see "Low" in Task Manager, I don't really need to use
>
>SetThreadPriority(lnhthread, THREAD_PRIORITY_LOWEST) ?
>
>However I may use it if I want to change thread priority within the previously set Process priority, or, for example, if there are 3 threads in the process and I want to change only one thread's priority. Right?
>

Not necessarily. It depends on what priority you want this particular process to take. Time slices are divied out on a thread priority basis not process basis. If you use SetPriorityClass, you are only setting the thread's priority so low. If you want to make it so time slicing is minimized on the threads in question, then you set the class to the lowest priority and then use SetThreadPriority to make it even lower.

See chart on Scheduling Priorities here. http://msdn.microsoft.com/library/en-us/dllproc/hh/winbase/prothred_75ir.asp
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform