Автор: Genri
Дата сообщения: 20.11.2006 18:36
Так сказать, для тренировки выкладывания в UUE, и для сообщества, выкладываю еще одну длл-ку с тремя функциями:
// Запуск консольного приложения
function ExecConsoleAppX(CommandLine: PChar): PChar;
external 'ExecConsoleAppX@files:ISTask.dll stdcall delayload';
// Завершение процесса по имени файла
function KillTask(ExeFileName: string): Integer;
external 'KillTask@files:ISTask.dll stdcall delayload';
// Проверка, запущен ли процесс по имени файла
function RunTask(FileName: string; bFullpath: Boolean): Boolean;
external 'RunTask@files:ISTask.dll stdcall delayload';
Надергал в свое время из инета и собрал в одну длл-ку. Скачать в формате UUE [more=здесь]
begin 0644 ISTask.zip
M4$L#!!0````(``N3=#5E=Y%V>A8````Z```*````25-487-K+F1L;.Q:#7!3
MUY6^!H<ZX(`#A!!BB!,<0AAB9$F15$L"&5O&(790+/_QCVR](!E94IZ>J$E-
MU@0[@Q%*/2ED6<HF_&V6IB1#$D_C.$RJ8A=#AG99ZJ1NX^FRA$T>P8!#7>(T
M+MIS[KN2GF4+=Z8SG>U.W\QYY]SO_-QS[SWW_4G%JRQD'"$DF4PAX3`A;40Z
M3&06&?-((J0]C4Q^H/7.7S[8EE3TRP=;6DH=3E^&E_=LY&VU&;5^GY!1Q67P
M?G>&WVWG^(P*IUNEO&MBIG;LX'^;PV(FI"CI.^2^=4L71+`+Y*6#DY+&W4=F
M0F..A!U]!$YI0`ILF21Y')T">B1'G%MBC7%1+9&<TZ(2(1L(X6D"A%1-`=X`
M-&&4!+V$I(S_*P:8X,A;D6]&WGTO2V@FD0U".C(@R_S<TER4%^()QX[%DC[<
MSD1(:*G52N4_,X`><T9T&\IRVFV"C8W9POJ.L\-X69QD1^=H`^LW:X2=)8OG
M7)YJ-D=>-@;%:'8^OAH;.,<-C*M'V@T#6AC/&</N[_@(/UQ78B*!4/AA@7$O
MXR[&'8S;&=_`^!K&*QDO9=S">!'CA8SG,VYBW,"XCG$UXPK&]S.^E_'=C+<P
MOHOQ'8PW4FZE%["FD)"WW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)2VP.MZ3GZGE>+B,-;WLO2E\W<U,6UL4>)PY'3IX[3DBO))XA8>ZC>
M!V'@>RJS9-\'6%]<RXB3L4)#[!WQ>$BNCGI;!MU_^AOT$U!+`P04````"``8
MDW0UFT_;%@8!``#/`0``!P```&YE=RYT>'2-T,%*PT`0!N![(.\PM[8@YIY>
MU&!!%!%1\+IFMVUPLAN2#=0G].@K!"4:$[-)J(B"H*.T8@M"3S,,_#,?XSAP
MDS7SKH32U)VI/FIS;Z!IB\H\Y'7Q:5OC5/HZ4!+V9\+WE$P4BMTHNNA[*@R9
MY$>!%"Z<>%,6#Q9U:%MBID4L&4)O+;8S#E`D[GG$MSDB))K[C"H7R*Y1,=ZC
ML&TYWZR[O'TC0TX<\YIW70:-@>*91O"2/579']MA@'C&DJL^71O1@6,6$BK1
M<2`GI#J06DS$JFL9V1ATVQH2E=D6/-+'WO,:JF))^U]VFLH?V+IJ")>C%#%B
M>NK"GJ+O,#GX[5:DBQ6;0+\`4$L!`A8`%`````@`"Y-T-65WD79Z%@```#H`
M``H````````````@`````````$E35&%S:RYD;&Q02P$"%@`4````"``8DW0U
MFT_;%@8!``#/`0``!P```````````"````"B%@``;F5W+G1X=%!+!08`````
.`@`"`&T```#-%P`````
end
[/more]
Добавлено:
если кому надо - есть исходники под делфи 5