Hi,
One thing that did strike me when reading your mail was when you said 
"application does not in itself require a GUI". When you hooked 
WM_QUERYENDSESSION + WM_ENDSESSION, are you sure your application is sitting on 
the event pump (Win32::GUI::Dialog) when windows shuts down? If it's not, then 
you wont get the messages before it's too late... 
Cheers,
Jeremy.

> Date: Wed, 23 Dec 2009 13:19:41 +0100
> From: s...@h-k.fr
> To: perl-win32-gui-users@lists.sourceforge.net
> Subject: [perl-win32-gui-users] Windows shutdown
> 
> 
> 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.
> 
> 
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev 
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> http://perl-win32-gui.sourceforge.net/
                                          
_________________________________________________________________
Use Hotmail to send and receive mail from your different email accounts
http://clk.atdmt.com/UKM/go/186394592/direct/01/
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/

Reply via email to