Re: Win32 -- lowering the priority of a process
- Posted by "Martin Stachon" <martin.stachon at tiscali.cz> Dec 31, 2003
- 433 views
Andy Serpa wrote: > I'd like to have my program automatically run at lower-than-normal > priority on Windows (as opposed to using the task manager to do it in XP > after it is already running). Anyone know how to have the program > choose its own priority? The tome of wisdom says : The SetPriorityClass function sets the priority class for the specified process. This value together with the priority value of each thread of the process determines each thread's base priority level. BOOL SetPriorityClass( HANDLE hProcess, // handle to the process DWORD dwPriorityClass // priority class value ); hProcess : Identifies the process. dwPriorityClass : Specifies the priority class for the process. Specify one of the following values: HIGH_PRIORITY_CLASS IDLE_PRIORITY_CLASS NORMAL_PRIORITY_CLASS REALTIME_PRIORITY_CLASS There's also SetThreadPriority, but I am not sure if this can be applied to Euphoria. -- Martin