TerminateProcess

TerminateProcess

Post by Steven Ang » Thu, 31 Jul 2003 01:47:59


I am opening a 16 bit application using CreateProcess in
VB. However, I need to be able to terminate this process.
The problem is that when i attempt to terminate the
process, using TerminateProcess, it never succeeds.
Is this because the process handle CreateProcess returned
is not the process handle for the NTVDM process.
Is it possible to get the NTVDM process handle, or is
there some way that I can kill the NTVDM process by
killing the 16 bit application?
 
 
 

TerminateProcess

Post by Tim Robins » Thu, 31 Jul 2003 16:44:28

Is this a 16-bit GUI application? If so, exit the app by closing its main
window.

In general, don't use TerminateProcess at all, unless there's a really
specific reason for it.

--
Tim Robinson (MVP, Windows SDK)
http://www.yqcomputer.com/

 
 
 

TerminateProcess

Post by Steven Ang » Thu, 31 Jul 2003 22:31:20

I think I may have been a little vague in my initial
email.
I am running a 16 bit program using CreateProcess. I then
use WaitForSingleObject to wait for the program to
finish. I occasionally get a GPF error in the 16 bit
application, so I have set the timeout property to return
control to the master program. If a timeout occurs I was
hoping to close the 16 bit program using TerminateProcess
(As far as I am aware, this is the only process that I can
use for this).
However, I am experiencing problems because I can't close
the 16 bit program using TerminateProcess. I think that
this is because because it's a 16 bit application, and
hence runs inside NTVDM.