無論是用vc還是用delphi,啟動外部程式,
呼叫的都是相同的系統中的api函式,如下delphi**所示:
//登入按鈕
procedure tform1.label_loginclick(sender: tobject);
begin
end;
//delphi啟動其它程式函式
begin
//使用winexec也可以開啟程式,這裡不用
//使用shellexecute必須引用shellapi.pas單元:uses shellapi;
//shellexecute原型如下
//hinstance shellexecute(
// hwnd hwnd,
// lpctstr lpverb,
// lpctstr lpfile,
// lpctstr lpparameters,
//lpctstr lpdirectory,
// int nshowcmd
//);
end;
delphi啟動外部程式執行結束
一 為什麼要啟動外部程式 二 預備知識 啟動外部程式我們可以使用函式winexec shellexecute和shellexecuteex。我推薦大家使用函式shellexecute,因為它既靈活,又簡單。看看下面的例子,用法就清楚了 啟動乙個程式 nil,nil,sw show 啟動記事本 因為記...
啟動外部程式
啟動外部程式我們可以使用函式winexec shellexecute和shellexecuteex。我推薦大家使用函式shellexecute,因為它既靈活,又簡單。看看下面的例子,用法就清楚了 啟動乙個程式 shellexecute handle,open lpcstr d 模擬程式.exe nu...
使用Delphi啟動和關閉外部應用程式
delphi與windows 平台緊密結合,編譯 快速高效。作為一種視覺化的物件導向開發工具,delphi可以幫助程式設計師更輕鬆 更快速地編寫各種windows應用程式。而且通過程式設計可以方便地呼叫其它語言編寫的動態庫或應用程式,並在不需要時關閉這些外部程式。這一點對許多程式設計人員非常有用,例...