執行需包括参數的外部程式? |
尚未結案
|
chengwei
一般會員 發表:18 回覆:9 積分:5 註冊:2005-04-04 發送簡訊給我 |
|
supman
尊榮會員 發表:29 回覆:770 積分:924 註冊:2002-04-22 發送簡訊給我 |
|
enu
中階會員 發表:36 回覆:93 積分:55 註冊:2003-10-22 發送簡訊給我 |
|
chengwei
一般會員 發表:18 回覆:9 積分:5 註冊:2005-04-04 發送簡訊給我 |
謝謝!
我在[Run]->[Paramerters]->[Paramerters]鍵入了要執行的外部程式及參數,但下面的程式片斷只是將"要執行的外部程式"及"參數"顯示出來而已,並沒有真正執行程式
void __fastcall TForm1::Button1Click(TObject *Sender) { for(int i=1; i<=ParamCount(); i ) ShowMessage(ParamStr(i)); }請問該呼叫那個function才能執行外部程式? 外部程式為: aa.exe 参數1 参數2 |
supman
尊榮會員 發表:29 回覆:770 積分:924 註冊:2002-04-22 發送簡訊給我 |
您好:
報歉,沒看清處您的問題
uses ShellApi
ShellExecute(Handle,'open','abc.exe','參數1 參數2 ",NULL,SW_SHOW); 函數原型
INSTANCE ShellExecute( HWND hwnd, // handle to parent window
LPCTSTR lpOperation, // pointer to string that specifies operation to perform
LPCTSTR lpFile, // pointer to filename or folder name string
LPCTSTR lpParameters, // pointer to string that specifies executable-file parameters
LPCTSTR lpDirectory, // pointer to string that specifies default directory
INT nShowCmd // whether file is shown when opened
); 發表人 - supman 於 2005/04/26 00:02:42
|
chengwei
一般會員 發表:18 回覆:9 積分:5 註冊:2005-04-04 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |