🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #440

Re: TCppWebbrowser, Toolbars and sending messages.

#440
From: 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
Technical Details
Message-ID: <458c9b3a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <458c829d@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,749d8e2a5a400a9e
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.web
References: <458c829d@newsgroups.borland.com>
Subject: Re: TCppWebbrowser, Toolbars and sending messages.
Date: Fri, 22 Dec 2006 18:57:37 -0800
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 75.83.34.171
Message-ID: <458c9b3a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1166842682 75.83.34.171 (22 Dec 2006 18:58:02 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail