SChatel
asked on
CreateProcess + Delphi
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.ProcessMessage s;
FillChar(SI, SizeOf(SI), 0);
SI.cb := SizeOf(SI);
si.dwFlags:=STARTF_FORCEON FEEDBACK; 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.ProcessMessage s;
I use Windows NT Workstation + Delphi 5
var
AppPath: String;
SI: TStartupInfo;
PI: TProcessInformation;
hProc: THandle;
sCodeRetour: DWORD;
begin
Application.ProcessMessage
FillChar(SI, SizeOf(SI), 0);
SI.cb := SizeOf(SI);
si.dwFlags:=STARTF_FORCEON
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,
CloseHandle(hProc);
Application.ProcessMessage
Or si.wShowWindow:=SW_SHOWMIN NOACTIVE;
ASKER
I have still try this, but it doesn't work.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your help
You are welcome :-)
Change this line:
si.wShowWindow:=SW_HIDE;
to
si.wShowWindow:=SW_MINIMIZ
Regards, Geo