Archive: Raise process priorty


Raise process priorty
Hello,

I want the "installer.exe" to find a Windowless process named "BLAH.EXE" that was started by the installer and raise BLAH.EXE process priorty to Above Normal? When I say Window-less process, I mean a program like "SVCHOST.EXE" that has no user interface or window name.

Ideally this would be through the System dll. Is this possible?


A few Google searches :
http://www.google.fr/search?hl=fr&q=...FR208&ie=UTF-8

http://www.google.fr/search?hl=fr&sa...meta=&aq=f&oq=


I was hoping there was a way to do it without a third-party plugin. Here is what I'm using for the parent process.

!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})"


I guess all I need is a way to find the handle to process blah.exe.

yup, this is the hard part.. can't be done easily with NSIS except with a plugin..

mmh I just realize the Processes plug-in doesn't return the ID of the target process... and then you would need to OpenProcess by ID to get the HANDLE and change priority...

I guess using the PrcView command-line tool is the easiest solution