From: Seb <se...@h-...> - 2009-12-23 15:57:26
|
Hi folks, Here is the question: I'm looking for a minimal example of a (perl) script that dies (gracefully or not) when Windows tries to shutdown. Story: I have developed an application that monitors via RS232 the health of TV screens attached to PCs. The information gathered is relayed to a central server. This application must run continuously, but still die when an automatic shutdown is triggered on the PC. The application works but doesn't die when asked to (via Start->Stop). I have a fair knowledge of Perl and Unix, but I am totally new to Windows programming: don't hesitate to state an obvious solution :-) Please note that the application does not in itself require a GUI. I tried a GUI following the discussion here: http://objectmix.com/perl/20692-win32-how-quit-perl-script-during-log-off-automatically.html A solution that would use Win32::API would also work for me, I just thought it might be simpler with Win32::GUI. I have tried to use GetMessage and PeekMessage, but I'm clearly not using them the right way (again, I know zilsch about Windows programming). I've read the archives on mail-archive.com and found discussions dating back to 2001 and 2004; they do not provide a working example alas. I also tried to understand the man pages on CPAN and the samples in the tarball, but couldn't find a hint there either. Any hope, err, help, would be much appreciated! Seb. |