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

關於 ShellExecute 用法

答題得分者是:adonis
kyo7458
一般會員


發表:3
回覆:0
積分:0
註冊:2005-09-28

發送簡訊給我
#1 引用回覆 回覆 發表時間:2007-05-15 15:28:16 IP:59.126.xxx.xxx 訂閱
關於 ShellExecute 用法

ShellExecute(Application.Handle, PChar('open'), PChar(filename), nil, nil, SW_Show);

ShellExecute(Handle, PChar('open'), PChar(filename), nil, nil, SW_Show);

ShellExecute(0, PChar('open'), PChar(filename), nil, nil, SW_Show);


請問一下 Application.Handle , Handle , 0 這些有甚麼分別 還有其他可套用參數嗎@@?
後面的 nil, nil, SW_Show
分別是設定甚麼的參數餒@@?
adonis
高階會員


發表:140
回覆:258
積分:159
註冊:2002-04-15

發送簡訊給我
#2 引用回覆 回覆 發表時間:2007-05-15 16:35:04 IP:210.201.xxx.xxx 訂閱
kyo7458,您好

你的問題在 help 中都可找得到,請善加利用,或透過站內的查詢也都有相當多的資料..
僅列出 help 中的說明 :
hwnd
Specifies a parent window. This window receives any message boxes that an application produces. For example, an application may report an error by producing a message box.

lpParameters
If lpFile specifies an executable file, lpParameters is a pointer to a null-terminated string that specifies parameters to be passed to the application.
If lpFile specifies a document file, lpParameters should be NULL.

lpDirectory
Pointer to a null-terminated string that specifies the default directory.
nShowCmd
If lpFile specifies an executable file, nShowCmd specifies how the application is to be shown when it is opened. This parameter can be one of the following values:
Value Meaning
SW_HIDE Hides the window and activates another window.
SW_MAXIMIZE Maximizes the specified window. ............

請自行參閱

我也在努力學習中,若有錯謬請見諒 ~

===================引 用 kyo7458 文 章===================
關於 ShellExecute 用法

ShellExecute(Application.Handle, PChar('open'), PChar(filename), nil, nil, SW_Show);

ShellExecute(Handle, PChar('open'), PChar(filename), nil, nil, SW_Show);

ShellExecute(0, PChar('open'), PChar(filename), nil, nil, SW_Show);


請問一下 Application.Handle? , Handle , 0 這些有甚麼分別? 還有其他可套用參數嗎@@?
後面的 nil, nil, SW_Show?
分別是設定甚麼的參數餒@@?

------
我也在努力學習中,若有錯謬請見諒。
編輯記錄
adonis 重新編輯於 2007-05-15 16:36:18, 註解 無‧
dangde
一般會員


發表:0
回覆:1
積分:0
註冊:2007-05-19

發送簡訊給我
#3 引用回覆 回覆 發表時間:2007-05-19 11:22:42 IP:202.103.xxx.xxx 訂閱
Application.Handle 是应用程序的句柄,Handle 是当前句柄,看你当前默认的句柄是谁了。 0 就是打开的这个窗体的父窗体是系统管理的。 你最好参考一下MSDN,里面有非常详尽的描述。
編輯記錄
dangde 重新編輯於 2007-05-19 11:23:45, 註解 無‧
系統時間:2024-04-27 3:21:18
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!