[DUG] Program Priority

Struan Judd struan.judd at ecargo.co.nz
Thu Mar 23 17:18:39 NZST 2006


If you have the necessary permissions you can use the following Win23
functions. Found courtesy of Platform SDK where you'llhave to check to get
the useful constant values etc.

HANDLE OpenProcess(
  DWORD dwDesiredAccess,
  BOOL bInheritHandle,
  DWORD dwProcessId
);

And

BOOL SetPriorityClass(
  HANDLE hProcess,
  DWORD dwPriorityClass
);



Struan Judd                                 Mailto:struan.judd at ecargo.co.nz
Developer                                   Phone:   +64 (9) 368 9368
eCargo                                      Fax:     +64 (9) 368 9369
Visibility - Communication - Measurement    Mobile:  +64 (21) 685 335
Private & Confidential                      http://www.ecargo.co.nz
-----Original Message-----
From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz] On
Behalf Of Eion McIntosh (Christchurch)
Sent: Thursday, 23 March 2006 3:57 p.m.
To: Delphi List Group
Subject: [DUG] Program Priority

Hi 

I have the code for finding the various processing running on a PC, but once
you have their pid numbers is there a call you can make to change its
running priority from normal to low? You can do this via the Task Manager
and doing Set Priority, but this requires used intervention, I would like
have it automated.

Regards
Eion McIntosh
PPCS Ltd 





More information about the Delphi mailing list