Syouchi
asked on
how to close console window
Hi, All.
My main program calls another DOS application by 'CreateProcess'API.
After that, the console window opens and DOS app. starts.
But I cannnot close the console window when DOS app. is over.
Please teach me how to code.
Syouchi.
My main program calls another DOS application by 'CreateProcess'API.
After that, the console window opens and DOS app. starts.
But I cannnot close the console window when DOS app. is over.
Please teach me how to code.
Syouchi.
so us your code. Zif.
ASKER
This is a part of my app.
'irp.exe' is encrypt DOS program I made.
-------------------------- ---------- ---------- -
function TFrCrypt.Angouka():string;
var
CodeFile,MyPath,ComLine,
OpenkeyPath,tmpS:string;
SI:TStartupinfo;
PI:TProcessInformation;
begin
MyPath := ExtractFilePath(ParamStr(0 ));
Opendialog1.InitialDir:=my path;
if OpenDialog1.Execute then
begin
CodeFile := OpenDialog1.FileName;
Angouka:=ChangeFileExt(Cod eFile,'.ir p');
IniFile:=TIniFile.Create(C hangeFileE xt(ParamSt r(0),'.ini '));
OpenkeyPath:=iniFile.readS tring('Cry pt','NkeyD ir','');
OpenkeyPath:=OpenkeyPath+' Syochi.opn ';
if AnsiupperCase(ExtractFileP ath(CodeFi le))=Ansiu pperCase(m ypath) then
CodeFile:=ExtractFilename( CodeFile);
ComLine := 'irp.exe /c '+ OpenkeyPath +' ' + CodeFile;
GetStartupInfo(SI);
tmpS := MyPath + ComLine;
CreateProcess(nil,PChar(tm pS),nil,ni l,false,0, nil,nil,SI ,PI);
end;
end;
-------------------------- ---------- ---------- ---------- -------
'irp.exe' is encrypt DOS program I made.
--------------------------
function TFrCrypt.Angouka():string;
var
CodeFile,MyPath,ComLine,
OpenkeyPath,tmpS:string;
SI:TStartupinfo;
PI:TProcessInformation;
begin
MyPath := ExtractFilePath(ParamStr(0
Opendialog1.InitialDir:=my
if OpenDialog1.Execute then
begin
CodeFile := OpenDialog1.FileName;
Angouka:=ChangeFileExt(Cod
IniFile:=TIniFile.Create(C
OpenkeyPath:=iniFile.readS
OpenkeyPath:=OpenkeyPath+'
if AnsiupperCase(ExtractFileP
CodeFile:=ExtractFilename(
ComLine := 'irp.exe /c '+ OpenkeyPath +' ' + CodeFile;
GetStartupInfo(SI);
tmpS := MyPath + ComLine;
CreateProcess(nil,PChar(tm
end;
end;
--------------------------
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dear ZifNab.
Your both ways lead me to success.
Thanks a lot.
Syouchi.
Your both ways lead me to success.
Thanks a lot.
Syouchi.
ASKER