How to add a button to the IE Toolbar

samool 发布暂无评论9056 阅读

AI摘要

This article provides a step-by-step guide on how to add a button to the Internet Explorer toolbar using Delphi programming. It explains the necessary parameters such as ButtonText, MenuText, CLSID, and Exec, and provides a code example for creating a button. The article also instructs users to start a new instance of IE and move the button to the "Current toolbar buttons" section.

From Zarko Gajic,
Your Guide to Delphi Programming.
FREE Newsletter. Sign Up Now!
Here's how to add a button to Interner Explorer toolbar:
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

After you run the code below, 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"

~~~~~~~~~~~~~~~~~~~~~~~~~
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;
~~~~~~~~~~~~~~~~~~~~~~~~~


  1. 01SaMDeditor V2.4 更新内容2026-12-02
  2. 02恭喜《轻武爱学习》小程序备案成功!2026-11-24
  3. 03SaView 图阅 1.1.1 更新日志2026-11-18
  4. 04Book2EPUB 1.0.4 更新日志2026-11-18
  5. 05SaView 图阅 一款轻便纯粹的看图工具2026-11-16
  6. 06免费工具Book2EPUB:轻松将电子书转换为 EPUB2026-11-11
  7. 07SaBlog2026 主题功能介绍(v1.1.36)2026-10-26
  8. 08PHP2Shell 重大安全漏洞事件深度分析报告2026-10-23
  9. 09LiteLLM v1.106.0 更新内容总结2026-10-20
  10. 10AI Native 受控软件工程2026-10-12
COMMENTS / 一纸留言

读者留言 0 条

一纸留言,便是山水间的一次相逢。

还没有留言,欢迎写下第一段交流。

WRITE A COMMENT

写下你的留言