How would reduce the memory for this particular perlsvc ?? It takes up
approx. 7.8mb... I'd like to see it under 2mb.

=== code====
use PerlTray;
use Win32::OLE qw( in );
use Win32::OLE::Variant;
use FindBin qw($Bin);

AmIRunning();

sub AmIRunning {
 $Machine = "\\\\.";
 $Machine = shift @ARGV if( $ARGV[0] =~ /^\\\\/ );

 # WMI Win32_Process class
 $CLASS =
"winmgmts:{impersonationLevel=impersonate}$Machine\\Root\\cimv2";
 $WMI = Win32::OLE->GetObject( $CLASS ) || die;

 if (defined &PerlTray::exe) {
  $FilePath = PerlTray::exe();
 }
 else {
  $FilePath = $0;
 }

 $FilePath =~ s/\//\\/g;

 $Instances = 0;

 foreach my $Proc ( sort {lc $a->{Name} cmp lc $b->{Name}} in(
$WMI->InstancesOf( "Win32_Process" ) ) ) {
  ## This looks for the executable filename only and will cause an exit
later
  #if ($FilePath =~ /$Proc->{Name}/i) {
   #$Instances++;
  #}

  # This looks for the full path to the executable filename and will
cause an exit later
  if ($Proc->{ExecutablePath} eq $FilePath) {
   $Instances++;
  }
 }

 if ($Instances > 1) {
  die;
 }
}

sub DoubleClick {
 system("rundll32 user32.dll,LockWorkStation");
}

sub Click {
 system("rundll32 user32.dll,LockWorkStation");
}

sub PopupMenu {
    return [["*Lock Workstation", sub{DoubleClick ()}],
  #["--------"],
  #["  E&xit", "exit"],
  ];
}

sub ToolTip { "Click to Lock WorkStation"}

=== end code===

===
Mike Singleton 
Network Analyst
(253) 272-1916  x1259
(253) 405-1968 (cellular)
[EMAIL PROTECTED]

DaVita Inc.
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to