Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Suspending a process (slighty OT)

by LD2 (Curate)
on Sep 23, 2001 at 23:26 UTC ( [id://114201]=note: print w/replies, xml ) Need Help??


in reply to Re: Suspending a process (slighty OT)
in thread Suspending a process (slighty OT)

From a Windows perspective... just use Win32::Process. $ProcessObj->Suspend(); and  $ProcessObj->Resume(); should do exactly what you wish to do.

Replies are listed 'Best First'.
Re: Re: Re: Suspending a process (slighty OT)
by $code or die (Deacon) on Sep 24, 2001 at 00:27 UTC
    I could be wrong, but I think that the Suspend and Resume methods only work on objects created by Win32::Process::Create().

    Simon Flack ($code or die)
    $,=reverse'"ro_';s,$,\$,;s,$,lc ref sub{},e;$,
    =~y'_"' ';eval"die";print $_,lc substr$@,0,3;
      It will work on anything regardless of how it was created, IF you can obtain a kernel handle to the process with suitable rights. Using the Win32 function to directly create a process is handy because that's what it returns (via the process information structure "out" parameter).

      There is a function, OpenProcess, that will give you a handle from the global "process identifier".

      Having separate handles and ID's is why Win32 doesn't have zombies.

      —John

        I know you can suspend and resume processes not created with the Win32::Process module. I've done it in the past using WMI. I can't see any OpenProcess method with the Win32::Process module, and I get this error if I try ant use it:
        Your vendor has not defined Win32::Process macro OpenProcess
        Update: it looks like OpenProcess() is a Win32 API and isn't implimented in Win32::Process. So my original statement stands - the Suspend() and Resume() methods will work only on processes created with Win32::Process::Create(). If you want to suspend a process that isn't create with that module, then you'll have to use WMI or the Win32 API.

        Simon Flack ($code or die)
        $,=reverse'"ro_';s,$,\$,;s,$,lc ref sub{},e;$,
        =~y'_"' ';eval"die";print $_,lc substr$@,0,3;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://114201]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-19 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found