Sets the priority class of a processΒΆ

set_process_priority()

Sets the priority class of a process

Version >= 6.0.3


SYNTAX

set_process_priority(server_name, process_handle, priority_class)

Changes the priority class of the specified process. The priority_class value is one of the PROCESS_PRIORITY defines in sculptor.h. These are equivalent to the priority classes in the Windows API but are not the values used in that API. The priority will only be changed if the process effecting the change has appropriate permissions. It will normally be possible for a process to change its own priority and that of its children. The real time priority should almost never be used. It is intended for use by drivers and very short duration programs that must respond immediately. Administrator privilege may be needed to set the priority class of a process not started by the calling program.

If server_name is NULL, sets the priority class of the specified local process.

If process_handle is 0, sets the priority class of the named Sculptor server.

If server_name is NULL and process_handle is 0, sets the priority class of the calling program.

Returns 0 if successful or -1 if an error occurs.

Note

The flags argument to the execute() command can be used to set the initial priority of a process on Windows but its values are not the same as the priority codes defined here. See the EXEC flags in /Sculptor/include/sculptor.h.


EXAMPLE

To set the server priority class:

set_process_priority(tmp.ServerName, 0, tmp.NewServerProcessPriority)

RELATED TOPICS

Process and thread priority classes

get_process_priority()

get_thread_priority()

set_thread_priority()