>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 GetWindow
ThreadProcessId() :)))
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.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao