>How do you search the set of running processes?
>
It's OS-dependent - at least two distinct methods exist, one works with Win9x and Win2K, the other with NT. Someone posted a file to do the first in the Files Section.
>This has definitely been a research project. We found about GetCurrentProcess, but I originaly was trying to set the thread priority instead of the PriorityClass which was not working. I also assumed that getting a -1 for a process handle meant that I had an invalid handle. Later when trying to set and reset the priority I didn't have problems.
>
>>>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.
>
>I am curious, as to how Windows would get mangled when changing the Process priority.
>
Read "Advanced Windows" by Jeffrey Richter.