X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: detecting process termination Date: 27 Oct 2004 12:37:40 GMT Lines: 19 Message-ID: <2u9j4kF27tti9U2@uni-berlin.de> References: X-Trace: news.uni-berlin.de cEl5BaEkel9I/K5rkANUEQ5XMJw3R51kuSj3E2nc/T4zQLjEjvaUXU81g5 X-Orig-Path: not-for-mail To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com rafael-_no-spam_- AT _-please-_geninfor DOT com wrote: > I would like to detect when the user clic on the X button to close the > process in which is running my program under Windows. > I thought it could be possible using signal() but I see SIGKILL and > SIGTERM are "currently unused". > żIs there any chance to know the program end is coming? Not the one induced by the Windows 'X' button: that one kills your virtual DOS machine ("VDM"), i.e. it doesn't even try to talk to your running DOS program. That's why you get a warning dialog if you use it ("Windows cannot shut down this program...") in essentially all situations but one: when command.com is idling on the command line (sometimes it takes a 'cls' for Windows to recognize this state). -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.