Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

WaitForSingleObject and DOS-Windows in Win98

Posted on 2002-05-10
2
Medium Priority
?
277 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
gd2000 earned 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

688 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