On 12/23/2009 07:19 AM, Seb wrote:

How about running your script as a Windows Service? If you need, I'll 
dig up an example for you.

As a service, you can't have a GUI, but it can communicate over a network.

Brian
> 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/
>
>    


------------------------------------------------------------------------------
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