Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Dos-app.safe?

Posted on 1997-05-22
4
Medium Priority
?
204 Views
Last Modified: 2010-04-04
How do I run an Dos-application safely (without any problems with memory, collision etc.)from my self-developed Delphi-application? I have tried to do it with the Winexec-command (WinExec('c:\test\test.exe' ,SW_maximize);), however it does not work properly all the times, only sometimes (Depending on ...?). Please give me a syntax example...
Thanks!!  Erik N
PS. I run Delphi Developer R2....
PS2. I do not understand the syntax of Createprocess,(I need a syntax example)...
0
Comment
Question by:Erik N
  • 2
4 Comments
 
LVL 4

Expert Comment

by:erajoj
ID: 1336542
Delphi version?
Have you looked at createprocess?
0
 

Author Comment

by:Erik N
ID: 1336543
Edited text of question
0
 

Author Comment

by:Erik N
ID: 1336544
Edited text of question
0
 
LVL 1

Accepted Solution

by:
sleach earned 300 total points
ID: 1336545
Here is an example of CreateProcess.  I have tested it, and it works fine Running Dos applications.

Hope this helps.

procedure TForm1.Button1Click(Sender: TObject);
VAR
TPI : TProcessInformation;
TSI : TStartupInfo;
begin
if OpenDialog1.execute then
  begin
  FillChar(TSI, SizeOf(TSI), 0);
  TSI.CB := SizeOf(TSI);
  CreateProcess(PChar(OpenDialog1.FileName), NIL, NIL, NIL, False,
    DETACHED_PROCESS OR NORMAL_PRIORITY_CLASS, NIL, NIL,
    TSI, TPI);
  end;

end;

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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 Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

885 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