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
Divers
Thread ID:
00502520
Message ID:
00502946
Vues:
19
Hi Vlad,

>Hi!
>
>Only one instance of NTWDM could be in the memory. If you kill it, you will kill all DOS or Windows 3.* programs currently running.
>

That does not seem to be correct (at least not for Windows 2000). There is an instance of NTVDM for every DOS window open and I have to loop through them to destroy them one by one.

>
>There are special API functions for DOS programs that are located in the separate DLL. I do not know details, but you can try to search from this side. Try also to send this to some other forums that are more related to API functions and low-level programming for Windows (For example, C++ forums).
>
>I can also post a sample of correct killing of windows application, but I did not tried it with DOS program (just to compare with your code), if you want.


I would like to see this. For now I used enumproc.dll from Downloads section and modified code of the sample call.



>
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform