線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:2813
推到 Plurk!
推到 Facebook!

有關ShellExecute的問題

答題得分者是:taishyang
cloudandy
一般會員


發表:9
回覆:0
積分:1
註冊:2006-07-10

發送簡訊給我
#1 引用回覆 回覆 發表時間:2008-09-02 18:03:09 IP:122.118.xxx.xxx 訂閱
請問ShellExecute若執行有錯誤~~有辦法知道嗎?!
taishyang
站務副站長


發表:377
回覆:5490
積分:4563
註冊:2002-10-08

發送簡訊給我
#2 引用回覆 回覆 發表時間:2008-09-02 18:12:38 IP:118.169.xxx.xxx 訂閱
Help裡面:

Return Values

If the function succeeds, the return value is the instance handle of the application that was run,
or the handle of a dynamic data exchange (DDE) server application.
If the function fails, the return value is an error value that is less than or equal to 32.
The following table lists these error values:

Value Meaning
0 The operating system is out of memory or resources.
ERROR_FILE_NOT_FOUND The specified file was not found.
ERROR_PATH_NOT_FOUND The specified path was not found.
ERROR_BAD_FORMAT The .EXE file is invalid (non-Win32 .EXE or error in .EXE image).
SE_ERR_ACCESSDENIED The operating system denied access to the specified file.
SE_ERR_ASSOCINCOMPLETE The filename association is incomplete or invalid.
SE_ERR_DDEBUSY The DDE transaction could not be completed because other DDE transactions were being processed.
SE_ERR_DDEFAIL The DDE transaction failed.
SE_ERR_DDETIMEOUT The DDE transaction could not be completed because the request timed out.
SE_ERR_DLLNOTFOUND The specified dynamic-link library was not found.
SE_ERR_FNF The specified file was not found.
SE_ERR_NOASSOC There is no application associated with the given filename extension.
SE_ERR_OOM There was not enough memory to complete the operation.
SE_ERR_PNF The specified path was not found.
SE_ERR_SHARE A sharing violation occurred.

pceyes
尊榮會員


發表:70
回覆:657
積分:1140
註冊:2003-03-13

發送簡訊給我
#3 引用回覆 回覆 發表時間:2008-09-03 06:46:16 IP:220.141.xxx.xxx 訂閱

[code delphi]
shellresult := shellexecute(...);
if shellresult > 32 then
begin
showmessage('執行成功');
end
else
begin
showmessage('執行失敗');
end;
[/code]
------
努力會更接近成功
系統時間:2024-04-26 15:05:07
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!