Adding an icon for your program or web page to the IE toolbar

From NSIS Wiki

Author: ZmAn3 (talk, contrib)


Description

These macros below add or remove items from the Internet Explorer toolbar. You have to restart Internet Explorer in order to work. You have to add that item from "Customize Toolbar" window in order to appear directly to your toolbar. Tested only on Windows XP SP2.

How To Use

${IEToolBarItem_Add} `GUID` `Name` `Exec` `Icon` `HotIcon` `DefVisible(Yes|No)`
GUID
Your application GUID. If you don't have one, use the function from Create a GUID, a Globally Unique Identifier page.
Name
Name of the item to appear as the button name.
Exec
File, folder or web page to open when clicking the button. Accepts parameters.
Icon
Specifies the icon to be used on normal state.
HotIcon
Specifies the icon to be used on mouse over state.
DefVisible(Yes|No)
Shows the button or not to the "Customize Toolbar" window. Default value is "No".
${IEToolBarItem_Remove} `GUID`
GUID
Your application GUID used on ${IEToolBarItem_Add}.

The Macros

!define IEToolBarItem_KeyName `SOFTWARE\Microsoft\Internet Explorer\Extensions`
 
!define IEToolBarItem_Add `!insertmacro IEToolBarItem_Add`
!macro IEToolBarItem_Add `GUID` `Name` `Exec` `Icon` `HotIcon` `DefVisible`
  WriteRegStr HKLM `${IEToolBarItem_KeyName}\${GUID}` `ButtonText` `${Name}`
  WriteRegStr HKLM `${IEToolBarItem_KeyName}\${GUID}` `CLSID` `{1FBA04EE-3024-11d2-8F1F-0000F87ABD16}`
  WriteRegStr HKLM `${IEToolBarItem_KeyName}\${GUID}` `Default Visible` `${DefVisible}`
  WriteRegStr HKLM `${IEToolBarItem_KeyName}\${GUID}` `Exec` `${Exec}`
  WriteRegStr HKLM `${IEToolBarItem_KeyName}\${GUID}` `Icon` `${Icon}`
  WriteRegStr HKLM `${IEToolBarItem_KeyName}\${GUID}` `HotIcon` `${HotIcon}`
  WriteRegStr HKLM `${IEToolBarItem_KeyName}\${GUID}` `IeakPolicy` ``
!macroend
 
!define IEToolBarItem_Remove `!insertmacro IEToolBarItem_Remove`
!macro IEToolBarItem_Remove `GUID`
  DeleteRegKey HKLM `${IEToolBarItem_KeyName}\${GUID}`
!macroend

Written by Zman3.
Modified by deguix.

http://www.emeraldcpu.com/zman3/main.php

Personal tools
donate
ads