🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
2 messages
2 total messages Started by Tom Sat, 23 Dec 2006 01:13
TCppWebbrowser, Toolbars and sending messages.
#439
Author: Tom
Date: Sat, 23 Dec 2006 01:13
12 lines
1110 bytes
Hello all,

1. Is it possible to load the installed toolbars (BHO's) with 
TCppWebbrowser?
I would like to only load a particular toolbar if it's available.

2. Once the toolbar is loaded, is there a way to enumerate it's controls and
be able to send messages to them?

Thanks,

Tom
Re: TCppWebbrowser, Toolbars and sending messages.
#440
Author: Remy Lebeau (TeamB)
Date: Sat, 23 Dec 2006 02:57
52 lines
3093 bytes
"Tom" <tom@nospam.net> wrote in message
news:458c829d@newsgroups.borland.com...

> Is it possible to load the installed toolbars (BHO's) with TCppWebbrowser?

Toolbars are not BHOs.  They are Desktop Bands.  Two different types of
objects.

To answer your question - no, TCppWebBrowser cannot load them.  It has no
toolbar of its own on which to display Bands.  It is only the main browser
window and nothing else.  As such, you will have to load them manually as
needed.  Use CoCreateInstance() to instantiate the desired object(s), then
query each one for its IObjectWithSite and IDeskBand interfaces.

Call the IDeskBand::GetBandInfo() method to determine the dimensions and
characteristics that the object expects for the ToolBar (or other window)
that you are going to display the object inside.

You will then have to implement your own class that derives from IOleWindow,
overriding the GetWindow() method to return an HWND to a suitable window
that the object will appear in.  Each object will create its own children
windows inside of the HWND that is passed to it.  You can then pass an
instance of that class to the IObjectWithSite::SetSite() method.

You will also have to query each object for the IDockingWindow, IInputObject
and IContextMenu interfaces if your application is going to pass focus,
mouse and keyboard input to each object (respectively).

> I would like to only load a particular toolbar if it's available.

You can certainly do that.  To know whether a given Band is installed, look
in the following Registry key:

    HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Toolbar

> Once the toolbar is loaded, is there a way to enumerate it's controls
> and be able to send messages to them?

Query the object for the IOleWindow interface.  If available, then the
IOleWindow::GetWindow() method will return the object's main HWND.  You can
then use normal API functions to enumerate it, such as FindWindowEx() and
EnumChildWindows().

Refer to MSDN for more information:

    Creating Custom Explorer Bars, Tool Bands, and Desk Bands

http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_adv/bands.asp


Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads