![]() |
| | #1 |
| Registered User Join Date: Dec 2003
Posts: 6
| I am developing a C programme for database management, and I need to make it unclosable unless the quit button is clicked. So I shall be realy thankful if anybody could help me out and tell me how to do it. I want to isable everything right from Ctrl+z to suspend to Ctrl+c for exit and Ctrl+Alt+Delete if possibal at all. Thanks in advance.... |
| scorpio_IITR is offline | |
| | #2 |
| still a n00b Join Date: Jun 2002
Posts: 187
| >> and I need to make it unclosable unless the quit button is clicked for GUI, don't know following for console ![]() Code: #include <signal.h> signal(SIGINT,SIG_IGN); /* disable ctrl-C */ signal(SIGQUIT,SIG_IGN); /* disable ctrl-\ */ signal(SIGTSTP,SIG_IGN); /* disable ctrl-Z */ |
| Jaguar is offline | |
| | #3 | |
| Registered User Join Date: Jan 2004
Posts: 6
| Re: How to prevent exiting from running program Quote:
stopping (sort of ):SIGINT (Ctrl-C) SIGABRT(Ctrl-\) SIGTERM SIGHUP pausing: SIGSTP (Ctrl-Z) you can't catch SIGKILL (kill -9) or SIGSTOP, as they're handled by the kernel; Ctrl+Alt+Del is a different story: in console mode, init snatches it, in X usually the desktop manager does. either way, you probably won't see it (and well you shouldn't - you can't handle the reset button either ) | |
| abc_coder is offline | |
| | #4 |
| still a n00b Join Date: Jun 2002
Posts: 187
| Re: Re: How to prevent exiting from running program >> SIGABRT(Ctrl-\) ?*?*? SIGQUIT >> SIGSTP (Ctrl-Z) SIGTSTP |
| Jaguar is offline | |
| | #5 | |
| Registered User Join Date: Jan 2004
Posts: 6
| Re: Re: Re: How to prevent exiting from running program Quote:
however, Ctrl-\ may send either the Posix "Quit" (SIGQUIT) or the Ansi "Abort" (SIGABRT) - it's terminal-dependent. | |
| abc_coder is offline | |
| | #6 |
| Registered User Join Date: Dec 2003
Posts: 6
| thanks for help buddies.... |
| scorpio_IITR is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Exiting the program. | Taka | C Programming | 6 | 10-14-2007 09:24 AM |
| How to tell when internal program is done running | PJYelton | Windows Programming | 5 | 03-21-2005 10:09 PM |
| Stop the current running program with another C program? | sqlin | C++ Programming | 0 | 04-27-2003 02:04 AM |
| exiting program | spike232 | C# Programming | 4 | 05-25-2002 08:18 PM |
| prevent exiting | Unregistered | A Brief History of Cprogramming.com | 4 | 12-12-2001 02:57 PM |