I have a Perl script running on Windows that functions as a wrapper to a second 
program -- a compiled executable I cannot change. Within my Perl script, I use 
'system' to call the second program and wait for it to return -- pretty basic. 
However, the second program calls ExitWindows() when it eventually ends (a few minutes 
to a few hours later), so my Perl script gets control back just long enough to print a 
line before perl (or wperl) gets terminated by Windows. What I need is for the Perl 
script to stay alive long enough to log this event to a file before Windows finishes 
logging out. 

A Windows GUI program could intercept the WM_QUERYENDSESSION message it receives as 
Windows logs out, so it could have a few seconds to do what it needs to do before 
responding to the message that it is ready to terminate (cf. 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/exitwindows.asp).

Is there any similar functionality available in Perl or a module or would this require 
hacking the perl source? I didn't find anything after a search through CPAN and on the 
web.

Thanks for any ideas,
Garyl

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to