KBBar buttons problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I've tried to use the KBBar sample to create a custom IE toolbar

http://support.microsoft.com/kb/246234

I cannot add more buttons to it. With some effort I was able to add another
one, but the 4th was impossible. I want 5. It sure looks like a stupid error
somewhere, some spooky things happened when I increased the button number
from 3 to 4. I won't go into details here. I also want to eliminate the
combo, which luckily was easy.

I've searched for other samples of course but couldn't find anything useful.
There is another more recent version of KBBar but it requires the .NET
package to run which I don't want. I believe there is no other sample to this
end on MSDN but if I'm wrong and there is a better one please indicate it to
me. Or if you know what's wrong with KBBar. Or maybe another way to create
simple working custom IE toolbars that can be freely distributed.

Regards
V. Simionescu
 
Thanks for taking the time to reply.

Thanks for the links too, though they’re not what I asked for. I had been at
the 2 MSDN locations you gave me for creating toolbars, of course. I’m sorry
but it’s too complicated. I don’t want to have to study a week in order to
create a rather simple toolbar. It shouldn’t have to be this way. As a matter
of fact it doesn’t have to be this way, the worst scenario at the moment
seems to be that I’ll use KBBar with only 3 buttons. I can limit myself to
this, but it would be better if I could have 5. I’d say it’s an incredibly
stupid limitation that I cannot, but at the moment that’s how it looks like.
Shouldn’t somebody at MS want to fix the sample BTW ? Or at least confirm me
that the problem is real, I don’t know, maybe I’m not doing the right thing.
I’ve tried all I knew (short of studying things in detail).

The other problem I have with KBBar right now is that I’m not sure if it’s
free for commercial use. The EULA doesn’t say, only that it’s to be used at
one’s own risk. I couldn’t find conclusive info anywhere. I assume it is,
being a sample, but could you please confirm it ?

I know there are scores of free toolbars but they all have their drawbacks
(not surprisingly since they are free). For instance, the one you gave me is
based on JavaScript, I’d like it to be C++ so that I can program easier.
Besides, I cannot tell whether it will function in a browser that has
scripting disabled, I believe it won’t. I couldn’t find it in the
documentation. Which is another setback, the documentation is rather poor.
Believe me, I did search, and the best I could find until now was the
crippled KBBar sample. Though I still have to look over some samples at
CodeProject.
(This is another inconvenience BTW, searching the Web thoroughly to find
something good is too time-consuming in itself. MS should have an
authoritative sample that also works.)

Regards
V. Simionescu
 
Hello again

I want to let everybody interested know that I found a way to add more
buttons to KBBar. It was mostly luck but also a little bit of hard work and
brilliance from my part I think.
Anyway, this is what I found: it looks like the problem wasn't the number of
buttons but their combined width. When it exceeds a certain value that's
around 60 - 70 pixels or so, no more buttons are added, InsertButton won't
work. I don't know why, I havent' debugged anything. But fortunately it turns
out that the problem occurs only at the moment of creation. That is, if the
buttons are created with a small width of say 10 px, 5 of them can be
created, then brought to their desired width by means of SetButtonInfo. Then
they work, and so far no other problem has occurred with the toolbar created
like this, which hopefully will stay like this. And which leads me to believe
even more that there is a bug at the way the buttons are created, since there
is no apparent reason for this behavior since the buttons do work if they are
created by this work-around.
There's another little catch, I'll mention it here to maybe save some work
to others: to create a button with a width of 10, you'd have to set the
bitmap width to around 8 or something. Unfortunately, then the button bitmaps
will be created accordingly and there's no way to set them back to their
intended width, or at least I couldn't find one. What I could find is that
you can create the button with the final (usually normal) width, that is let
the bitmap width normal and use InsertButton as usual, then shrink the button
immediately after creation via SetButtonInfo, before adding another button by
the same process. When you're done adding all buttons this way, you can bring
them back to their final width by using SetButtonInfo again. By this process
you'll be able to create at least 5 buttons, possibly 6. If you need more,
which you probably won't but if you do, you probably can use an initial width
of 5, I don;t see any reason why it shouldn't work, though I personally
haven't tried it.

Anyway, related to this issue, I found an IE toolbar sample that looks
promising, at

http://www.codeproject.com/wtl/toolband.asp

I didn't get to test it because first I thought I'd satisfy myself with the
3-button KBBar, then when it turned out it wasn't enough I was too advanced
in the project and didn't want to change anything, so I insisted with KBBar
(searching for other ways such as combining 2 buttons in one) and in the
process I unintentionally found this work-around. But if I had to do it from
scratch I'd first look at this sample, I had a brief look at it and it seems
well written and documented, and I found some positive references also.

Hope I can be of help with this to as many as possible that have the same
problems I had. I'd also appreciate, if anybody gets any help from this, post
back here and let me know, first of all I'd like to know if anybody uses the
toolbar sample above and is satisfied with it or, if not, what the problems
were.

V. Sim.
 
question about kbbar

I read your article and understood that you worked lot on kbbar sample. Even I am using kbbar sample and I have one question regarding that. If you have little time, I will be thankfull for your help. Even I search lot of articles regarding my issue but couldn't find any details yet.
I want only one button on toolbar and I am able to do that. But my further requirement is clicking on that button I would like to open another dialog or form. I am using vc++6. Clicking on that button I can call exe application but I want to call within my kbbar dll. I have another application developed in vc++6 using mfc. I would like to call it from this kbbar button.
If any suggestion or any links plz let me know.
Thanks for your time.
 
Back
Top