Solved

WaitForSingleObject and DOS-Windows in Win98

Posted on 2002-05-10
2
267 Views
Last Modified: 2012-06-27
I'm trying to start a DOS-Application under Win98
from Delphi with CreateProcess.
Further on I want to wait for the end of the
execution, using WaitForSingleObject.

The problem is, that DOS-applications as default
do not automatically close the DOS-window when
finished. So I have to close the window manually,
to make WaitForSingleObject detect the end of
the execution.

I used sw_hide - option to prevent from displaying
the DOS-window, but this does not help.

For normal applications the property can be set manally
with applications file|properties ..close.. (don't know the exact name in the english version...).

Can I simply change the default options for DOS-windows,
or can I use CreateProcess with special options to
close after execution end??


Thanks for help,

Gamba

0
Comment
Question by:Gamba
2 Comments
 
LVL 1

Accepted Solution

by:
gd2000 earned 100 total points
ID: 7000746
When you initiate the DOS program prefix it with the following:

command.com /c <nameofprog>

This means that once the DOS program has finished executing it will close automatically (e.g. type "command.com /c dir" into the run command at the start button. WaitForSingleObject will pick up on the close then.
0
 

Author Comment

by:Gamba
ID: 7000805
Great, this works!!!

Thank you,

Gamba

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now