صدا زدن تابع CreateProcess() به ساده ترین روش - ک دلفی

function CreateProcessSimple(sExecutableFilePath: string ): string; var pi: TProcessInformation; si: TStartupInfo; begin FillMemory(@si, sizeof(si), 0); si.cb := sizeof(si);

CreateProcess( nil, PChar( sExecutableFilePath ), // path to the executable file: 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;

/ 0 نظر / 6 بازدید