Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Raise process priorty (http://forums.winamp.com/showthread.php?t=314468)

secured2k1 8th November 2009 17:46

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?

Wizou 12th November 2009 09:14

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=

secured2k1 12th November 2009 20:25

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.

code:
!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.

Wizou 13th November 2009 08:04

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


All times are GMT. The time now is 04:31.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.