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

如何用windows api設定某檔案會被某程式打開的檔案關聯性

尚未結案
ybmh
一般會員


發表:20
回覆:14
積分:6
註冊:2004-01-14

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-01-30 11:00:07 IP:210.202.xxx.xxx 未訂閱
如何用Windows API設定某檔案會被某程式打開的檔案關聯性 我知道用RegSetValue這個API在登錄檔下註冊就行了 以下這個API是用VB裡的API-Viewer找出來的: Public Declare Function RegSetValue Lib "advapi32.dll" Alias "RegSetValueA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal dwType As Long, ByVal lpData As String, ByVal cbData As Long) As Long 有誰知道參數hKey,dwType怎麼得到ㄋ??
qoo1234
版主


發表:256
回覆:1167
積分:659
註冊:2003-02-24

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-02-08 17:47:49 IP:218.163.xxx.xxx 未訂閱
RegSetValue() Writes a given value to the registry. Currently only a PChar-type can be written. To store boolean or integer values, they must be converted. function RegSetValue(Key: HKey; SubKey: PChar; ValType: Longint; Value: PChar; cb: Longint): Longint; Key: The Handle of the parent key (can be HKEY_CLASSES_ROOT). SubKey: The subkey for which the value should be stored. ValType: must be REG_SZ for Win31. Value: The value to be stored. cb: Size in bytes for the Value parameter. Windows 3.1 ignores this paramater. Returns: ERROR_SUCCESS if function was successful; otherwise an error is returned. 網海無涯,學無止境!
ybmh
一般會員


發表:20
回覆:14
積分:6
註冊:2004-01-14

發送簡訊給我
#3 引用回覆 回覆 發表時間:2004-02-08 21:58:55 IP:211.21.xxx.xxx 未訂閱
我已經找到做法了 方法是: 開啟檔案總管->工具->資料夾選項->檔案類型 ->選取某個要查閱的副檔名(例如WAV)->進階 觀察此關聯性的設法 進入到REGEDIT裡到HKEY_CLASSES_ROOT找到.WAV觀察裡面的KEY寫了哪些值 在BCB程式裡利用RegSetValue()寫入此檔案關聯所需要的值即可
系統時間:2024-05-19 1:14:16
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!