Killing processes on Windows (again)

I'm going to need a little more help on this.

I start up my process with

      process = wxProcess(window)
            self.pid = wxExecute(self.cmd, wxEXEC_ASYNC, process)

later (as the result of a 'Stop' button press), I do

            wxProcess_Kill(self.pid, wxSIGTERM)

But so far as I can see this has no effect on the process. Moreover, it
seems to me that I should be able to write a signal handler for that
process and have the handler catch the signal that wxProcess_Kill() sends.
But I don't have a clue how to do this since the signal handling in os
seems incompatible with that in wxWindows.

I must be missing something pretty fundamental here, but what?

···

--------------------------------------
Gary H. Merrill
Director and Principal Scientist, New Applications
Data Exploration Sciences
GlaxoSmithKline Inc.
(919) 483-8456

                    "Robin Dunn"
                    <robin@alldunn.com>
                                                                                                  
                                                   To: wxPython-users@lists.wxwindows.org
                    12-Jun-2003 14:18
                    Please respond to cc:
                    wxPython-users@lists.wxw Subject: Re: [wxPython-users] Killing
                    indows.org processes on Windows
                                                                                                  
gary.h.merrill@gsk.com wrote:

Okay, how do you do it? I.e., what's the recommended way. The usual
os.kill() and wxProcess.Kill() don't seem to be supported (besides which

I

might not even have a wxProcess via which to kill).

wxProcess::Kill is a static method in C++ so you access it in wxPython
as wxProcess_Kill(pid, signal), and it doesn't need to have an existing
wxProcess instance to work.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

I'm going to need a little more help on this.

I start up my process with

      process = wxProcess(window)
            self.pid = wxExecute(self.cmd, wxEXEC_ASYNC, process)

later (as the result of a 'Stop' button press), I do

            wxProcess_Kill(self.pid, wxSIGTERM)

But so far as I can see this has no effect on the process.

Does wxSIGKILL do anything?

Moreover, it
seems to me that I should be able to write a signal handler for that
process and have the handler catch the signal that wxProcess_Kill() sends.
But I don't have a clue how to do this since the signal handling in os
seems incompatible with that in wxWindows.

A signal is identified as just an int, so there shouldn't be anything to be compatible with. That said, posix signal support in the MS C runtime library (which is what os is built on,) is notoriously weak and, um... underimplemented...

···

gary.h.merrill@gsk.com wrote:

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!