How to set Application Execution Priority to High.
-
Hi, I need to set my application execution priority to high, as we do in Task Manager (Screenshot attached below for reference) is it possible to set app execution priority to high in the code or settings? Kindly help me.
-
@Rajesh-Panati
This is outside the scope of Qt, and is also completely OS-dependent. (You should not be allowed to raise the priority of a program within itself, and Linux at least won't let you do it.) Windows Task Manager is presumably a privileged/elevated running program, which allows it to alter other process's priorities. Goodness knows whether raising a process's priority has any real, noticeable effect under Windows.You may be able to achieve something under Windows by looking at
QThread::currentThread()->setPriority()
, but I'm not sure that does anything for the application as a whole. You could also look atSetPriorityClass
Win32 function; again, I don't know whether you can raise your own, already-running priority. -
@Bonnie
Which is what I suggested: so Windows does allow a process to boost its own priority, without any non-default/elevated privileges? In which case, it wouldn't surprise me if loads of applications might do this, everyone thinks their program is more important than anyone else's! ;-)