Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Killing the DOS window, Part II.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Killing the DOS window, Part II.
Divers
Thread ID:
00502520
Message ID:
00502520
Vues:
72
Hi All,

I managed to be able to kill the FoxPro DOS application running in a DOS window.
But, there is one problem. I can find the window handle by the window name. I can find the process handle related to the DOS window name. That process handle points me to CMD.EXE, and if I try to kill it, nothing happens to actual DOS window, despite the return code from TerminateProcess API function is 1. In order to kill the real DOS process I have to kill the related ntvdm.exe.

So, the question is, how I can find the ntvdm.exe process which is related to corresponding CMD.EXE? If there is more than one DOS window, how do I know which ntvdm.exe corresponds to the certain window name?

Of course I can just loop through all ntvdm.exe instances and kill them all, but that would be overkill... :)
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform