Mastodon

CreateProcess

[code lang=”delphi”]function CreateProcessSimple(sExecutableFilePath : string ): string;
var
pi: TProcessInformation;
si: TStartupInfo;
begin
FillMemory( @si, sizeof( si ), 0 );
si.cb := sizeof( si );
CreateProcess(Nil, PChar( sExecutableFilePath ),
Nil, Nil, False, NORMAL_PRIORITY_CLASS,
Nil, Nil, si, pi );

// “after calling code” such as
// the code to wait until the
// process is done should go here

CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
end;[/code]

[tags]Delphi, API[/tags]

0 Kommentare zu “CreateProcess

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.