Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Browsers / Internet Explorer / September 2007



Tip: Looking for answers? Try searching our database.

BHO + Toolbar Button checked

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
justonemail@gmail.com - 06 Sep 2007 19:41 GMT
Hi,

Ive just developed a BHO along with adding a button to the toolbar.

My problem is that i want the BHO to be active only when my toolbar
button is checked.

my dll implements IOleCommandTarget so whenever my button is pressed i
do something like this

m_bChecked = isBtnChecked(...);
if (m_bChecked) {
                        ::SendMessage(hWndToolBar, TB_CHECKBUTTON, nIDCommand,
MAKELPARAM(0,0));
&vEmpty);
                    } else {
                        ::SendMessage(hWndToolBar, TB_CHECKBUTTON, nIDCommand,
MAKELPARAM(1,0));
                    }

and the bho related code uses the m_bChecked button just fine.

The problem is that this works in IE7 but im having alot of problem on
IE6. Whenever i click somewhere outside my button, it gets unchecked/
unpressed again. What i want is the exact click behavior of the native
"search" toolbar button.

Any help much appreciated.

-Tom
Rob ^_^ - 06 Sep 2007 21:47 GMT
Hi Justone,
Try the IE7 Extension Development Forum
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=924&SiteID=1

Quick answer. BHOs and Toolbars are loaded when IE first starts. You can't
'unload' them from the current Thread. All you can do is but a flag in your
BHO to stop its events from firing when it is 'disabled'.
You will also have to contend with the Addons Manager (users can disable
your BHO and leave your toolbar enabled) and the 'Enable third-party browser
helper objects' user settings.

Regards.
> Hi,
>
[quoted text clipped - 26 lines]
>
> -Tom
justonemail@gmail.com - 07 Sep 2007 00:40 GMT
Hi Rob,

Im not sure you got my problem.

the m_bChecked member is used by the bho to act on certain events or
not. My problem is the appearance of the button. When it's clicked the
first time under IE6 i change it to looked checked, with the following
code

::SendMessage(hWndToolBar, TB_CHECKBUTTON, nIDCommand,
MAKELPARAM(1,0));

The problem manifest its self with IE6 when focus on the button
vanished (by clicking somewhere a link the html document or outside
the browser).
However my code works as intended under IE7.

Please note, i dont have a toolbar or a band. Just the toolbar button
and the bho.

Tom

> Hi Justone,
> Try the IE7 Extension Development Forumhttp://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=924&SiteID=1
[quoted text clipped - 40 lines]
>
> > -Tom
Rob ^_^ - 07 Sep 2007 07:59 GMT
Hi Tom,

I don't have access to IE6 at the moment, but it sounds like a redraw
message is being sent to the rebar when it is clicked or focus is lost,
whereas in IE7 the Command bar is separate from the rebar. For IE6 I would
guess that you have to change the Icon value in the registry.
You will find some threads in the IE7 Extension Development forum on
altering the appearance of Button extensions. Search for the keywords
rebar... I posted the headers for it. Its a bit beyond the scope of this NG.

Regards.
> Hi Rob,
>
[quoted text clipped - 66 lines]
>>
>> > -Tom
justonemail@gmail.com - 07 Sep 2007 20:28 GMT
Thanks Rob,

Found your post on the rebar. I'll take a look at it next. In the
meantime, is there a way i can catch the redraw event on by button?

best
Tom

> Hi Tom,
>
[quoted text clipped - 80 lines]
>
> >> > -Tom
Rob ^_^ - 07 Sep 2007 21:14 GMT
Hi Tom,

The tool of choice is Spy++ which you will find in the Tools folder of
Visual Studio. You will need a Callback to capture the windows messages that
are redrawing your button. There are some other posts on the forum about
command bar buttons that may be helpful.

Regards.
> Thanks Rob,
>
[quoted text clipped - 95 lines]
>>
>> >> > -Tom
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.