Archive: change process priority?


change process priority?
is there a way an nsis installer can increase its own process priority? i'd like to add an option, so that the user can decide whether he wants to increase the process priority in order to speed up an time-consuming operation.


i guess it could be a security feature of window not to allow an application to increase its own process priority? i hope, but then again it's windows ;)


You can use SetPriorityClass:

!define NORMAL_PRIORITY_CLASS   0x00000020
!define IDLE_PRIORITY_CLASS 0x00000040
!define HIGH_PRIORITY_CLASS 0x00000080
!define REALTIME_PRIORITY_CLASS 0x00000100

System::Call "kernel32::GetCurrentProcess() i .s"
System::Call "kernel32::SetPriorityClass(i s, i ${HIGH_PRIORITY_CLASS})"

how to use that class with another program?