in reply to Re: Catching WINDOW close event and take actions
in thread Catching WINDOW close event and take actions

Sorry for a little extension to this question, what is the signal name/code when we kill process using CTRL+ALT+DEL task manager Can we catch it and take cleanup actions

Appreciate the inputs.

  • Comment on Re^2: Catching CTRL+ALT+DEL close event and take actions

Replies are listed 'Best First'.
Re^3: Catching CTRL+ALT+DEL close event and take actions
by zentara (Cardinal) on Sep 22, 2011 at 09:23 UTC
    CTRL-ALT-DEL is usually picked up by the Window Manager, or from console it is the reboot signal. A user cannot intercept that, see Control-Alt-Delete.

    In general, a user process is not able to intercept the Control-Alt-Delete sequence.

    Try this:

    #!/usr/bin/perl use warnings; use strict; sub handler_universal { print "\ngot a signal $_[0]\n"; $SIG{$_[0]} = \&handler_universal; } my @nami = keys(%SIG); #foreach( @nami){ print "$_\t$SIG{$_}\n"; } while(1){ for my $namesig (@nami) {$SIG{$namesig} = \&handler_universal;} }

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh

      I think he is talking about deleting a process using taskmanager, or using http://live.sysinternals.com/pskill.exe

      Like CTRL+ALT+DELETE, you can't trap this either

      It ends the process without signaling it (Ctrl+C sends a signal)