Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CreateProcess + Delphi

Posted on 2001-06-20
6
Medium Priority
?
866 Views
Last Modified: 2010-04-06
I launch a cmd file with this code, and I don't understant why my dos window doesn't want to do in the windows 's toolbar  ?

I use Windows NT Workstation + Delphi 5

var
  AppPath: String;
  SI: TStartupInfo;
  PI: TProcessInformation;
  hProc: THandle;
  sCodeRetour: DWORD;

begin

  Application.ProcessMessages;

 
  FillChar(SI, SizeOf(SI), 0);
  SI.cb := SizeOf(SI);
  si.dwFlags:=STARTF_FORCEONFEEDBACK;       si.wShowWindow:=SW_HIDE;

if not CreateProcess(nil, PChar(AppPath)  , Nil, Nil, False,
                   REALTIME_PRIORITY_CLASS, Nil, Nil, SI, PI) then

   
    raise Exception.CreateFmt('Error',
                              [GetLastError]);

  hProc := PI.hProcess;
  CloseHandle(PI.hThread);

  if WaitForSingleObject(hProc, Infinite) <> Wait_Failed then
   
 
  CloseHandle(hProc);

 
  Application.ProcessMessages;

 
 
0
Comment
Question by:SChatel
[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
  • 4
  • 2
6 Comments
 
LVL 17

Expert Comment

by:geobul
ID: 6209553
Hi,

Change this line:
si.wShowWindow:=SW_HIDE;
to
si.wShowWindow:=SW_MINIMIZE;

Regards, Geo
0
 
LVL 17

Expert Comment

by:geobul
ID: 6209566
Or si.wShowWindow:=SW_SHOWMINNOACTIVE;
0
 

Author Comment

by:SChatel
ID: 6209654
I have still try this, but it doesn't work.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 17

Accepted Solution

by:
geobul earned 120 total points
ID: 6209785
Hi,
si.dwFlags:=STARTF_FORCEONFEEDBACK or STARTF_USESHOWWINDOW;

if STARTF_USESHOWWINDOW is not specified, the wShowWindow is ignored.

Regards, Geo    
0
 

Author Comment

by:SChatel
ID: 6210027
Thanks for your help
0
 
LVL 17

Expert Comment

by:geobul
ID: 6210714
You are welcome :-)
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

618 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