谢谢satanmonkey兄,我确实是想在ie的toolbar上添加此类按钮。目前IE5Tools这个第三方提供的单元可现实一个小按扭的添加。但我还没找到可以添加图标是三角形的小按钮,点击弹出菜单的方法。IE5Tools单元中有过程如下:
function AddToolbarBtn(Visible: Boolean; ConnType: TConnType; BtnText, HotIcon, Icon, GuidOrPath: string): string;
var
G: TGUID;
Reg: TRegistry;
UID: string;
begin
CoCreateGuid(G);
UID := GuidToString(G);
Reg := TRegistry.Create;
with Reg do try
RootKey := HKEY_LOCAL_MACHINE;
OpenKey('/Software/Microsoft/Internet Explorer/Extensions/' + UID, True);
if Visible then
WriteString('Default Visible', 'Yes') else
WriteString('Default Visible', 'No');
WriteString('ButtonText', BtnText);
WriteString('HotIcon', HotIcon);
WriteString('Icon', Icon);
case ConnType of
COM_OBJECT: begin
WriteString('CLSID', '{1FBA04EE-3024-11d2-8F1F-0000F87ABD16}');
WriteString('ClsidExtension', GuidOrPath);
end;
EXPLORER_BAR:
begin
WriteString('CLSID', '{E0DD6CAB-2D10-11D2-8F1A-0000F87ABD16}');
WriteString('BandCLSID', GuidOrPath);
end;
SCRIPT:
begin
writeString('CLSID', '{1FBA04EE-3024-11D2-8F1F-0000F87ABD16}');
WriteString('Script', GuidOrPath);
end;
EXECUTABLE:
begin
WriteString('CLSID', '{1FBA04EE-3024-11D2-8F1F-0000F87ABD16}');
WriteString('Exec', GuidOrPath);
end;
end;
CloseKey;
OpenKey('/Software/IE5Tools/ToolBar Buttons/', True);
WriteString(BtnText, UID);
CloseKey;
finally
Free;
end;
Result := UID;
end;
实现功能是通过修改注册来实现的,采用其中的方法可以添加ToolBar、按钮、COM对象插件、脚本等等。IE5TOOLS单元我也是刚刚才接触(在网上可以找到),satanmonkey兄可以参考一下,看看能不能顺利解决此问题。谢谢!