Hi,
Someone knows how to set run priority for a process launched by PB?
Run priority has 6 levels:
Real Time: 24
High: 13
Above Normal:10
Normal:8
Below Normal:6
Idle:4
How to change the process among them?
How to set run priority?
Re: How to set run priority?
Code: Select all
SetPriorityClass_(hProcess.l, dwPriorityClass.l)
Code: Select all
SetPriorityClass_(GetCurrentProcess_(), #REALTIME_PRIORITY_CLASS)
However I'm not sure if that's what you meant.
Good programmers don't comment their code. It was hard to write, should be hard to read.
-
- User
- Posts: 11
- Joined: Fri Sep 15, 2006 8:04 am
- Location: FR
Re: How to set run priority?
SetPriorityClass don't seem to exist under Pure Basic 
Max could you give me your test result ?

Max could you give me your test result ?
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
If you are using the demo version of PureBasic, the API calls aren't available directly, which could be why you're not finding it. If that's the case, you can do it another way:SetPriorityClass don't seem to exist under Pure Basic
Code: Select all
#HIGH_PRIORITY_CLASS = $80
OpenLibrary(0, "kernel32.dll")
process = CallFunction(0, "GetCurrentProcess")
CallFunction(0, "SetPriorityClass", process, #HIGH_PRIORITY_CLASS)
CloseLibrary(0)
BERESHEIT