----- Original Message ----- From: <[EMAIL PROTECTED]> To: <perl-win32-users@listserv.ActiveState.com> Sent: Thursday, August 25, 2005 7:05 PM Subject: Trap window close
> Hi, > > Have looked at sigint to trap the "window close" event but am a little lost. Also took a look in MSDN, but got the impression that such events applied only to web browser windows. > > We run some scripts in cmd prompt windows on win2k and I would like to > ignore it if someone accidentally clicks the 'x' to close the window. Is > that possible? Does someone have a bit of code? > You want to distinguish between an *accidental* click on 'x' and a *deliberate* click on 'x' ?? (Of course you don't .... I'm just being facetious :-) Have you played with the idea of having the console window created by "Administrator" ? I'm thinking that such a window could not be closed by "User" (though that "thought" is untested). Perhaps 'perldoc Win32::Process' and 'runas /?' could provide useful ideas in that regard. SIG{INT} traps should work fine on Windows NT/2000/XP, but afaik, such traps/handlers work only with regards to Ctrl-C, not with clicking on 'x'. I'm no expert ... hopefully any incorrect statements I've made will be corrected by those "in the know" .... stay tuned :-) Cheers, Rob _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs