none
Programatically hide or show a toolbar button?

    Question

  • Hi,

    I've added a toolbar button to IE (following the simple directions here: http://msdn.microsoft.com/en-us/library/aa753588.aspx).  I'd like to add a checkbox to my application's settings that allows the user to hide or show this button (instead of going to the "Customize Command Bar" and doing it in IE).  I'm trying to figure out exactly what setting IE is using to determine whether to display a toolbar button or not.  I had hoped it was just another registry setting along side the rest of the settings for each button, but IE doesn't seem to add anything there when I use Customize Command Bar to add and remove my button.

    Any ideas how to do this?
    Colin
    Friday, June 05, 2009 10:22 PM

Answers

  • Hi,

    to hide your toolbar buttons just use empty strings for the icon and hoticon values, to make them show (the next time IE is loaded) just replace the registry values with valid file paths to your icons.

    IE ignores any buttons resources that it can't resolve the resources for.

    Ie 8 is different though as it has limits on the number of command bar buttons, you may see your button appear with a the cogs icon and be disabled, even though your resitry values are valid.

    Regards.
    Rob^_^
    • Marked as answer by colindb Monday, June 08, 2009 6:54 PM
    Sunday, June 07, 2009 3:34 AM
  • Yeah, IE doesn't provide any programmatic access to the command bar layout.  There is a binary blob in the registry you can reverse engineer and parse yourself... but I really don't recommend going down that road.


    • Marked as answer by colindb Monday, June 08, 2009 6:53 PM
    Monday, June 08, 2009 6:46 PM

All replies

  • Hi,

    to hide your toolbar buttons just use empty strings for the icon and hoticon values, to make them show (the next time IE is loaded) just replace the registry values with valid file paths to your icons.

    IE ignores any buttons resources that it can't resolve the resources for.

    Ie 8 is different though as it has limits on the number of command bar buttons, you may see your button appear with a the cogs icon and be disabled, even though your resitry values are valid.

    Regards.
    Rob^_^
    • Marked as answer by colindb Monday, June 08, 2009 6:54 PM
    Sunday, June 07, 2009 3:34 AM
  • Yeah, IE doesn't provide any programmatic access to the command bar layout.  There is a binary blob in the registry you can reverse engineer and parse yourself... but I really don't recommend going down that road.


    • Marked as answer by colindb Monday, June 08, 2009 6:53 PM
    Monday, June 08, 2009 6:46 PM
  • Yeah, I've reverse engineered enough IE blobs already, I have no desire to jump back into that.  I think I'm going to try to avoid adding any controls in my application (and just point the user to IE instead).  If I'm forced to do something myself I'll use a hack like IE IECUSTOMIZER mentioned.  Thanks guys!
    Monday, June 08, 2009 6:53 PM