Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, These question has probably

Status
Not open for further replies.

Tve

Programmer
May 22, 2000
166
FR
Hi,

These question has probably already been posted, but since the search does not work at this time, I cannot check this out.

I am trying the [red]Win32::process;[/red] module.

I have created a process using

[red]Win32::process::Create($ProcessObj,
"C:\\WINNT\\NOTEPAD.EXE",
"",
0,
NORMAL_PRIORITY_CLASS,
".")|| die ErrorReport();

[/red]

I can get the process Id using:

[red]$ID = $ProcessObj->GetProcessID();[/red]

If I let the code sleep 15 seconds and during these 15 seconds I close notepad.exe, how can I check if these process is still running in the perl script?

Thierry
 
Hi Thierry,

Instead of calling sleep() try

$ProcessObj->Wait($timeout)

From the Perl dox
Wait for the process to die. $timeout should be specified in milliseconds. To wait forever, specify the constant INFINITE Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top