全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:703
推到 Plurk!
推到 Facebook!

調用一個可執行文件並等待它結束

 
ctx62
一般會員


發表:4
回覆:28
積分:6
註冊:2002-12-12

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-10-20 11:47:48 IP:61.182.xxx.xxx 未訂閱
調用一個可執行文件並等待它結束 uses Wintypes,WinProcs,Toolhelp,Classes,Forms; Function WinExecAndWait(Path : string; Visibility : word) : word; var InstanceID : THandle; PathLen : integer; begin { inplace conversion of a String to a PChar } PathLen := Length(Path); Move(Path[1],Path[0],PathLen); Path[PathLen] := #0; { Try to run the application } InstanceID := WinExec(@Path,Visibility); if InstanceID < 32 then { a value less than 32 indicates an Exec error } WinExecAndWait := InstanceID else begin Repeat Application.ProcessMessages; until Application.Terminated or (GetModuleUsage(InstanceID) = 0); WinExecAndWait := 32; end; end;
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-10-20 11:57:28 IP:147.8.xxx.xxx 未訂閱
Delphi 1 (WinTypes, WinProcs)? GetModuleUsage is a 16bit API and has been removed from Win32...
系統時間:2024-06-29 15:29:50
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!