Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i set a processes priority using win api???? 1

Status
Not open for further replies.

Oxymoron

Technical User
Dec 17, 2000
168
GB
Hi,
I've made a small program which listens on the parallel port for incoming data. The program works fine but uses alot of cpu time since it has an infinite do...while loop which listens.

Is there a windows api method which can set a process' priority. I've heard there's one called SetProcessClass() (it think thats the name) but i wasnt sure what the parameters were.

If anyone knows id be very grateful for any and all suggestions.

Thanks very much,
jOe

we are all of us living in the gutter.
But some of us are looking at the stars.
 
Call SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS) and your process will only run when no other process needs the CPU.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top