Ramakrishna Neela

Could anyone help me in adding a new dropdown button to IE7 toolbar I'm new to this area. Any help would be appreciated.


Re: Internet Explorer Extension Development Sample code to add new button to IE 7 tool bar

Danny Young

Hi, Ramakrishna;

If I'm correct in my assumption, you want to add a button to the upper-part of IE7's toolbar, the permanent bar; next to the icon of the house.You said, "drop down," so this might not be what you want; however, in IE 6, a button added to this part of the registry is added to the "Tools" menu; the "MenuText" (see the registry values below) is, I'm almost certain, the field that determines the "Tools" menu text display.

When I need to add a button to the IE 7 toolbar, I usually do so through the registry, although you mentioned "code," so I'm not sure if a registry setting is something you've considered; however, a registry setting can be implemented as code would; by right-clicking on the registry file and selecting "merge." Alternatively, you can simply double-click it.

Here's the location in the registry where you would need to add the text to add a button and a sample of the values in the registry you'll need to look for. A quick word of advice: Back up your registry before you make any changes to it. Although this section of the registry, in my experience, is innocuous in terms of the damage that could be done if an incorrect value is entered, caution is suggested.

If I've omitted some steps regarding the registry, or if I've included suggestions about the registry that are offensive because of your familiarity with, apologies; I'm not aware of your experience with it.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Extensions\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}]
"CLSID"="{1FBA04EE-3024-11D2-8F1F-0000F87ABD16}"
"Exec"="\"C:\\Program Files\\Fiddler\\Fiddler.exe\""
"Default Visible"="Yes"
"ButtonText"="Fiddler"
"Icon"="\"C:\\Program Files\\Fiddler\\IE_Toolbar.ico\""
"HotIcon"="\"C:\\Program Files\\Fiddler\\IE_Toolbar.ico\""
"MenuText"="Fiddler"
"MenuStatusBar"="Launch the Fiddler HTTP Debugger."

A couple of quick and important notes on these values:

The HKEY local machine, in addition to being the location of the registry setting, contains an alphanumeric string you will need to generate. I use GUID Gen; you can find it on the Microsoft website.

The CLSID key should be the same for each browser; however, I'm not sure if it's different for IE 6 and 7 so check it out.

A browser restart is required after you've altered these registry settings.

Hope this helps.






Re: Internet Explorer Extension Development Sample code to add new button to IE 7 tool bar

Ramakrishna Neela

Thanks a lot for the reply Danny.

My requirement is I want to create and publish one addon to IE6/IE7. In this addon I want to add my own button to IE7 toolbar which will have dropdown list (button with down arrow button). So I would like to create setup.exe kind of file which I can distribute. I'm trying to understand your code above as I'm new to this area.






Re: Internet Explorer Extension Development Sample code to add new button to IE 7 tool bar

sumeetpk

Hi Ram,

I think you are looking for something which ismentioned in this article.

http://www.codeproject.com/shell/IEMenuButton.asp select=2057514&df=100&forumid=342636&msg=2057514

Same is being explained by Danny.

Correct me Danny if wrongSmile.

Regards

Sumeet





Re: Internet Explorer Extension Development Sample code to add new button to IE 7 tool bar

Ramakrishna Neela

Thanks Summet. I have already looked at the code. Just wondering how to add a drop-down arrow to button. And also how to add new menu items (configurable) to drop down menu dynamically.




Re: Internet Explorer Extension Development Sample code to add new button to IE 7 tool bar

sumeetpk

OK..Ram

I was abt to put up the same question.As i am facing the same problem as you are.

Same thing is available at

http://msdn.microsoft.com/library/default.asp url=/library/en-us/dhtmltechcol/cols/dnwebteam/webteam11062001.asp also

But faced the same issue with above also.

Regards

Sumeet





Re: Internet Explorer Extension Development Sample code to add new button to IE 7 tool bar

IECUSTOMIZER

Hi Sumeet and Ram,

I think that off hand there is a windowstyle attribute in the rebar library for a dropdown toolbar button. For an example I think the Yahoo toolbar adds dropdown buttons to the Command bar.

Hope this helps.

Regards.






Re: Internet Explorer Extension Development Sample code to add new button to IE 7 tool bar

sumeetpk

Thanks ....

I have tried this,but its not workingSad

Also,

http://www.codeproject.com/shell/IEMenuButton.asp select=2057514&df=100&forumid=342636&msg=2057514

from above link we see that if we use particular CLSID for adding a toolbar button.We are not able to get those styles on the toolbar button.

Regards

Sumeet





Re: Internet Explorer Extension Development Sample code to add new button to IE 7 tool bar

vikrantkpr

Hey Folks

Found anything regarding the same

And as suggested by IECUSTOMIZER where is this rebar library & window style

Regards





Re: Internet Explorer Extension Development Sample code to add new button to IE 7 tool bar

IECUSTOMIZER

Code Snippet

Option Explicit

Private Declare Function LoadImage Lib "user32" Alias "LoadImageA" (ByVal hinst As Long, ByVal lpsz As String, ByVal un1 As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal un2 As Long) As Long
Private Declare Function LoadImageLong Lib "user32" Alias "LoadImageA" (ByVal hinst As Long, ByVal lpsz As Long, ByVal un1 As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal un2 As Long) As Long
Private Const CF_BITMAP = 2
Private Const LR_LOADMAP3DCOLORS = &H1000
Private Const LR_LOADFROMFILE = &H10
Private Const LR_LOADTRANSPARENT = &H20
Private Const IMAGE_BITMAP = 0

Private Const sCLASS_REBAND = "ReBarWindow32"

Private Type NMHDR
hwndFrom As Long
idfrom As Long
code As Long
End Type

Private Type REBARINFO
cbSize As Integer
fMask As Integer
hIml As Long
End Type

Private Type REBARBANDINFO
cbSize As Long
fMask As Long
fStyle As Long
clrFore As Long
clrBack As Long
lpText As String
cch As Long
iImage As Long
hWndChild As Long
cxMinChild As Long
cyMinChild As Long
cx As Long
hbmBack As Long
wId As Long
End Type

Private Type REBARBANDINFO_NOTEXT
cbSize As Long
fMask As Long
fStyle As Long
clrFore As Long
clrBack As Long
lpText As Long
cch As Long
iImage As Integer 'Image
hWndChild As Long
cxMinChild As Long
cyMinChild As Long
cx As Long
hbmBack As Long 'hBitmap
wId As Long
End Type
Private Const H_MAX As Long = &HFFFF + 1


Private Const CCS_TOP = &H1
Private Const CCS_NOMOVEY = &H2
Private Const CCS_BOTTOM = &H3
Private Const CCS_NORESIZE = &H4
Private Const CCS_NOPARENTALIGN = &H8
Private Const CCS_ADJUSTABLE = &H20
Private Const CCS_NODIVIDER = &H40
Private Const CCS_VERT = &H80
Private Const CCS_LEFT = (CCS_VERT Or CCS_TOP)
Private Const CCS_RIGHT = (CCS_VERT Or CCS_BOTTOM)
Private Const CCS_NOMOVEX = (CCS_VERT Or CCS_NOMOVEY)


Private Const REBARCLASSNAME = "ReBarWindow32"
Private Const RBN_FIRST = H_MAX - 831 '// rebar
Private Const RBN_LAST = H_MAX - 859
Private Const RBIM_IMAGELIST = &H1

'Rebar Styles
Private Const RBS_AUTOSIZE = &H2000
Private Const RBS_VERTICALGRIPPER = &H4000 ' // this always has the vertical gripper (default for horizontal mode)
Private Const RBS_TOOLTIPS = &H100
Private Const RBS_VARHEIGHT = &H200
Private Const RBS_BANDBORDERS = &H400
Private Const RBS_FIXEDORDER = &H800

Private Const RBBS_VARIABLEHEIGHT = &H40
Private Const RBBS_GRIPPERALWAYS = &H80 ' always show the gripper
Private Const RBBS_BREAK = &H1 ' break to new line
Private Const RBBS_FIXEDSIZE = &H2 ' band can't be sized
Private Const RBBS_CHILDEDGE = &H4 ' edge around top & bottom of child window
Private Const RBBS_HIDDEN = &H8 ' don't show
Private Const RBBS_NOVERT = &H10 ' don't show when vertical
Private Const RBBS_FIXEDBMP = &H20 ' bitmap doesn't move during band resize

Private Const RBBIM_STYLE = &H1
Private Const RBBIM_COLORS = &H2
Private Const RBBIM_TEXT = &H4
Private Const RBBIM_IMAGE = &H8
Private Const RBBIM_CHILD = &H10
Private Const RBBIM_CHILDSIZE = &H20
Private Const RBBIM_SIZE = &H40
Private Const RBBIM_BACKGROUND = &H80
Private Const RBBIM_ID = &H100
Private Const WM_USER = &H400
Private Const RB_BEGINDRAG = (WM_USER + 24)
Private Const RB_ENDDRAG = (WM_USER + 25)
Private Const RB_DRAGMOVE = (WM_USER + 26)
Private Const RB_HITTEST = (WM_USER + 8)
Private Const RB_INSERTBANDA = (WM_USER + 1)
Private Const RB_DELETEBAND = (WM_USER + 2)
Private Const RB_GETBARINFO = (WM_USER + 3)
Private Const RB_SETBARINFO = (WM_USER + 4)
Private Const RB_GETBANDINFO = (WM_USER + 5)
Private Const RB_SETBANDINFOA = (WM_USER + 6)
Private Const RB_SETPARENT = (WM_USER + 7)
Private Const RB_GETRECT = (WM_USER + 9)
Private Const RB_INSERTBANDW = (WM_USER + 10)
Private Const RB_SETBANDINFOW = (WM_USER + 11)
Private Const RB_GETBANDCOUNT = (WM_USER + 12)
Private Const RB_GETROWCOUNT = (WM_USER + 13)
Private Const RB_GETROWHEIGHT = (WM_USER + 14)
Private Const RB_SETBKCOLOR = (WM_USER + 19)
Private Const RB_GETBKCOLOR = (WM_USER + 20)
Private Const RB_SETTEXTCOLOR = (WM_USER + 21)
Private Const RB_GETTEXTCOLOR = (WM_USER + 22)
Private Const RB_SIZETORECT = (WM_USER + 23) '// resize the rebar/break bands and such to this rect (lparam)
Private Const RB_MINIMIZEBAND = (WM_USER + 30)
Private Const RB_MAXIMIZEBAND = (WM_USER + 31)
Private Const RB_SHOWBAND = (WM_USER + 35) '// show/hide band
Private Const RB_MOVEBAND = (WM_USER + 39) ' // move band

Private Const RBHT_NOWHERE = &H1
Private Const RBHT_CAPTION = &H2
Private Const RBHT_CLIENT = &H3
Private Const RBHT_GRABBER = &H4

Private Const RB_INSERTBAND = RB_INSERTBANDA
Private Const RB_SETBANDINFO = RB_SETBANDINFOA
Private Const RBN_HEIGHTCHANGE = (RBN_FIRST - 0)

Private Const WM_NOTIFY = &H4E&

Found in Commctl32.ocx






Re: Internet Explorer Extension Development Sample code to add new button to IE 7 tool bar

vikrantkpr

Thanks a a lot

it appears we are very near the solution :-)

i noticed another thing

Install SkyPe

Skype adds a Button to IE

Notice the drop down

go to registry & change the name of ButtonText from SkyPe to anything else

Restart IE

The Dropw Down from the Skype Button disappears





Re: Internet Explorer Extension Development Sample code to add new button to IE 7 tool bar

IECUSTOMIZER

Hi, this is probably releated. I think it is an IE7 feature, although at the moment I do not have my win2k machine to compare.

This is the HKCR\CLSID for the Address Bar

Code Snippet

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{01E04581-4EEE-11D0-BFE9-00AA005B4383}]
@="&Address"
"MenuTextPUI"="@browseui.dll,-13137"

[HKEY_CLASSES_ROOT\CLSID\{01E04581-4EEE-11D0-BFE9-00AA005B4383}\Implemented Categories]

[HKEY_CLASSES_ROOT\CLSID\{01E04581-4EEE-11D0-BFE9-00AA005B4383}\Implemented Categories\{00021492-0000-0000-C000-000000000046}]

[HKEY_CLASSES_ROOT\CLSID\{01E04581-4EEE-11D0-BFE9-00AA005B4383}\InProcServer32]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,62,00,72,00,\
6f,00,77,00,73,00,65,00,75,00,69,00,2e,00,64,00,6c,00,6c,00,00,00
"ThreadingModel"="Apartment"

Note that the

[HKEY_CLASSES_ROOT\CLSID\{01E04581-4EEE-11D0-BFE9-00AA005B4383}\InProcServer32] default value is of type hex(2)

When you view the node in regedit you see "%SystemRoot%\system32\browseui.dll"

If you change that value to browseui.dll and save it back in the registry you end up with

Code Snippet

[HKEY_CLASSES_ROOT\CLSID\{01E04581-4EEE-11d0-BFE9-00AA005B4383}\InProcServer32]
@="%SystemRoot%\\System32\\browseui.dl"

Note that it is exported as a string.

Subsequently the next time you reboot, the Address bar will not appear on the shell browser or Task bar even though it appears in the list of available toolbars.

I guess that you have to do a unicode converstion on the string before writing it to the registry.

Regards.






Re: Internet Explorer Extension Development Sample code to add new button to IE 7 tool bar

John Lister

Hi, i just wondered if anyone had managed to add an menu and downarrow to a toolbar button using this thread
Even better (for me) would be to have a separator like the printer button that allows you to press the main part to do something and the arrow only to bring up the menu.. Any suggestions

Thanks




Re: Internet Explorer Extension Development Sample code to add new button to IE 7 tool bar

Quanbing peng

I implement a toolbar button for IE 6&7 that is same theory of skype toolbar button. Give me your e-mail, i give a demo code for you.





Re: Internet Explorer Extension Development Sample code to add new button to IE 7 tool bar

IECUSTOMIZER

Hi,

IECustomizer@hotmail.com

You may like to consider posting your solution to one of the public forums for the benefit of all.

Regards.