Question and Answer Database FAQ1738C.txt Closing DosApp spawned with WinExec() Category :Windows API Platform :All Windows Product : BC++4.5x BC++5.x C++Builder1.0 C++Builder3.x TC++Win4.5 Question: I am using the WinExec function in my Windows program. I obtain the handle to the window to destroy it ( i.e . get its handle and use SendMessage with a WM_DESTROY message). If I execute a windows program using WinExec everything works fine in Windows95. However if I execute a DOS program, the program on termination leaves a window with a "finished — program name" window text. Even though I am able to obtain the windows handle ( I checked it by changing the window text ) I am unable to destroy it . Answer: You should choose Properties for your DOS-app (or correspondong .pif) in the explorer and check the 'Close on exit' checkbox. 5/18/98 8:57:10 AM
Last Modified: 01-SEP-99