note
afoken
<p>Microsoft Windows has no concept of signals, we've discussed that in [id://815492] and some other threads. Perl implements an emulation, but it is not perfect, and it probably won't help you here.</p>
<p>Windows sends lots of messages to a <i>window</i> when it thinks the <i>process</i> owning the window should terminate, like WM_CLOSE and WM_QUIT. So you need to catch those messages. With a console window, things are a little bit more complicated, as Windows fakes some keypresses (from memory - RTFM), too, and you can't catch the messages sent to the console window (from memory - RTFM). And ultimately, Windows can forcefully terminate a process by directly invoking <c>ExitProcess()</c> or the like from the processes' context, without any way for the process to stop or delay that (similar to <c>kill -9</c>, but implemented as "forced suicide").</p>
<p>Alexander</p>
<div class="pmsig"><div class="pmsig-747201">
--<br>
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
</div></div>
815542
815542