Help - Search - Member List - Calendar
Full Version: setting program priority by PID
WorkTheWeb Forums > Webmaster Resources > Perl Beginner Help
Support our Sponsors!
Ing. Branislav Gerzo
Hello,

I'm on windows and I'd like to set program priority, if I know program
PID. It is possible ?

Thanks

--

--. ,-- ,- ICQ: 7552083 |||/ `//EB: www.2ge.us
,--' | - |-- IRC: [2ge] (. .) ,\SN: 2ge!2ge_us
`====+==+=+===~ ~=============-o00-(_)-00o-================~
"Of all the Charlie Browns in the world, you're the Charlie
Browniest."

Luke Bakken
QUOTE
Hello,

I'm on windows and I'd like to set program priority, if I know program
PID. It is possible ?
Ing. Branislav Gerzo
Bakken, Luke [BL], on Thursday, March 3, 2005 at 09:26 (-0800) wrote
these comments:

BL> Use Win32::Process:
BL> http://search.cpan.org/~jdb/libwin32-0.24/Process/Process.pm

thanks, now I can set priority of running program:

use strict;
use warnings;
use Win32::Process::Info;
use Win32::Process;
use Win32;

my $pi = Win32::Process::Info->new();

for my $x ( $pi->GetProcInfo() ) {
if ( $x->{Name} =~ /program_name/i ) {
my $po;
Win32::Process::Open($po,$x->{ProcessId},0) || die "Errorn";
$po->SetPriorityClass(IDLE_PRIORITY_CLASS);
exit;
}
}

Perl is amazing...:)

--

...m8s, cu l8r, Brano.

[Don't just do something, stand there.]


PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2006 Invision Power Services, Inc.