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

在IE上增添一個按鈕

 
jackkcg
站務副站長


發表:891
回覆:1050
積分:848
註冊:2002-03-23

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-09-14 01:30:19 IP:61.64.xxx.xxx 未訂閱
作者:昆明 閻磊 uses registry; var Reg1: TRegistry; begin Reg1:=TRegistry.Create; Reg1.RootKey := HKEY_LOCAL_MACHINE; Reg1.OpenKey('\SOFTWARE\Microsoft\Internet Explorer\Extensions', True); Reg1.CreateKey('{37E91B47-F40A-11D1-B792-444553540000}'); Reg1.OpenKey('\SOFTWARE\Microsoft\Internet Explorer\Extensions\{37E91B47-F40A-11D1-B792-444553540000}', True); Reg1.WriteString('ButtonText', '按鈕名稱');//按鈕名 Reg1.WriteString('CLSID','{1FBA04EE-3024-11D2-8F1F-0000F87ABD16}');//系統默認id,是一定,你可以參考網路螞蟻的 Reg1.WriteString('Default Visible', 'Yes');//缺省可以 Reg1.WriteString('Exec', 'F:\煙葉\Baccy.exe'); //按鈕要執行的事件 Reg1.WriteString('HotIcon', 'C:\WIN98\WINUPD.ICO');//熱圖示 Reg1.WriteString('Icon', 'C:\WIN98\WEB\chang.ico');//圖示 Reg1.CloseKey; Reg1.Free; end; //本人的運行環境爲windows2000 delphi5 ********************************************************* 哈哈&兵燹 最會的2大絕招 這個不會與那個也不會 哈哈哈 粉好 Delphi K.Top的K.Top分兩個字解釋Top代表尖端的意思,希望本討論區能提供Delphi的尖端新知 K.表Knowlege 知識,就是本站的標語:Open our mind to make knowledge together! 希望能大家敞開心胸,將知識寶庫結合一起
------
**********************************************************
哈哈&兵燹
最會的2大絕招 這個不會與那個也不會 哈哈哈 粉好

Delphi K.Top的K.Top分兩個字解釋Top代表尖端的意思,希望本討論區能提供Delphi的尖端新知
K.表Knowlege 知識,就是本站的標語:Open our mind
Miles
尊榮會員


發表:27
回覆:662
積分:622
註冊:2002-07-12

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-09-15 09:07:40 IP:218.160.xxx.xxx 未訂閱
轉貼一篇, 大同小異 http://delphi.about.com/bltip0502.htm
{
1. ButtonText = Text at the bottom 
of the button 
2. MenuText = The tools menu item with 
a reference to your program. 
3. MenuStatusbar = *Ignore* 
4. CLSID = Your unique classID. 
You can use GUIDTOSTRING to create 
a new CLSID (for each button).       5. Default Visible := Display it. 
6. Exec := Your program path to execute. 
7. Hoticon := (Mouse Over Event) 
ImageIndex in shell32.dll 
8. Icon := ImageIndex in shell32.dll
}      procedure CreateExplorerButton;
const
  // the same explanation as for the CLSID
  TagID = '\{10954C80-4F0F-11d3-B17C-00C0DFE39736}\';
var
  Reg: TRegistry;
        ProgramPath: string;
  RegKeyPath: string;
begin
 ProgramPath := 'c:\folder\exename.exe';
 Reg := TRegistry.Create;
 try
  with Reg do begin
   RootKey := HKEY_LOCAL_MACHINE;
   RegKeyPath := 'Software\Microsoft\Internet Explorer\Extensions';
   OpenKey(RegKeyPath   TagID, True);
   WriteString('ButtonText', 'Your program Button text');
   WriteString('MenuText', 'Your program Menu text');
   WriteString('MenuStatusBar', 'Run Script');
   WriteString('ClSid', '{1FBA04EE-3024-11d2-8F1F-0000F87ABD16}');
   WriteString('Default Visible', 'Yes'); 
   WriteString('Exec', ProgramPath);
   WriteString('HotIcon', ',4');
   WriteString('Icon', ',4');
  end
 finally
  Reg.CloseKey;
  Reg.Free;
 end;
end;
{
After you run this code, start a new 
instance of IE. You might need to go to
View | Toolbars | Customize and
move your button from "Available toolbar
buttons" to "Current toolbar buttons"  
}     
我不是高手, 高手是正在銀幕前微笑的人.
------


我不是高手, 高手是正在銀幕前微笑的人.
系統時間:2024-05-03 2:24:22
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!