summaryrefslogtreecommitdiff
path: root/bin/Process_Win32.pm
blob: 400d778c6e4535fe68b26712b9f72d50aeb4b34a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# $Id$
package Process;

use Win32::Process;

$EXE_EXT = ".exe";

$newwindow = "yes";

sub Create
{
  my $name = shift;
  my $args = shift;
  my $self = [];

  my $console = 0;

  if ($newwindow eq "yes")
  {
    $console = CREATE_NEW_CONSOLE;
  }
  else
  {
    $console = 0;
  }

  Win32::Process::Create ($self->[0], $name, $name." ".$args, 0, 
                          $console, ".");
  bless $self;
}  

sub Kill
{
  my $self = shift;
  Win32::Process::Kill ($self->[0], -1);
}

sub Wait
{
  my $self = shift;
  Win32::Process::Wait ($self->[0], INFINITE);
}

1;