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/ex
itwindows.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


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

Reply via email to