Article View: borland.public.cppbuilder.internet.web
Article #1302About WebBrowser Customization.. Please Help me..
From: jini
Date: Tue, 08 Mar 2005 12:38
Date: Tue, 08 Mar 2005 12:38
93 lines
3642 bytes
3642 bytes
How use IDocHostUIHandler, IDocHostUIHander2, IDocHostShowUI, and ICustomDoc
Etc..
i coded like below..
//--------------------------------------------------------------------------
----
void __fastcall TMainForm::get_I (IHTMLDocument2 *HTMLDoc)
{
Mshtml_tlb::IHTMLWindow2 *HTMLWindow = NULL;
HTMLDoc->get_parentWindow(&HTMLWindow);
IOleObject *pOleObject = NULL;
IOleClientSite *pOleClientSite = NULL;
IOleDocumentSite *pOleDocumentSite= NULL;
IDocHostUIHandler *pHostUIHandler = NULL;
IDocHostShowUI *pHostShowUI = NULL;
ICustomDoc *pCustomDoc = NULL;
//HTMLWindow->navigate((WideString)"http://www.yahoo.co.kr"); <-- it
works good.
//HTMLWindow->alert((WideString)"test message"); <-- it works good.
if ( SUCCEEDED( HTMLWindow->QueryInterface(IID_IOleObject,
(LPVOID*)&pOleObject )) )
{
ShowMessage("OK-0"); // <-- not visible
}
if ( SUCCEEDED( HTMLWindow->QueryInterface(IID_IOleDocumentSite,
(LPVOID*)&pOleDocumentSite )) )
{
ShowMessage("OK-a"); // <-- not visible
}
if ( SUCCEEDED( HTMLWindow->QueryInterface(IID_IOleClientSite,
(LPVOID*)&pOleClientSite )) )
{
ShowMessage("OK-1"); // <-- not visible
}
if ( SUCCEEDED( HTMLWindow->QueryInterface(IID_IDocHostUIHandler,
(LPVOID*)&pHostUIHandler )) )
{
ShowMessage("OK-2"); // <-- not visible
}
if ( SUCCEEDED( HTMLWindow->QueryInterface(IID_IDocHostShowUI,
(LPVOID*)&pHostShowUI )) )
{
ShowMessage("OK-3"); // <-- not visible
}
if ( SUCCEEDED( HTMLWindow->QueryInterface(IID_ICustomDoc,
(LPVOID*)&pCustomDoc )) )
{
ShowMessage("OK-4"); // <-- not visible
}
ShowMessage("DONE!");
}
//--------------------------------------------------------------------------
----
How get pOleObject, pOleDocumentSite, pOleClientSite, pCustomDoc,
pHostUIHandler, pHostShowUI, pCustomDoc.. Etc ??
MSDN say < The mechanism for WebBrowser Control customization is designed to
be automated when a container provides support for ActiveX controls.
Whenever the WebBrowser Control is instantiated, it attempts to find
IDocHostUIHandler, IDocHostUIHandler2 and IDocHostShowUI implementations
from the host, if they are available. The WebBrowser Control does this by a
QueryInterface call on the host's IOleClientSite interface.>
I guss if sucess to get IOleClientSite or IOleObject then it is possible to
get IDocHostUIHandler, IDocHostUIHandler2, IDocHostShowUI...
like this
if ( SUCCEEDED( pOleObject ->QueryInterface(IID_ICustomDoc,
(LPVOID*)&pCustomDoc )) )
{
// to do...
}
Please help me..................... thanks.
Technical Details
Message-ID:
<422d9caa@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: feeec,2e915bcaf988658,start X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "jini" <fseconds@hotmail.com> From: "jini" <fseconds@hotmail.com> Newsgroups: borland.public.cppbuilder.internet.web Subject: About WebBrowser Customization.. Please Help me.. Date: Tue, 8 Mar 2005 21:38:12 +0900 Lines: 95 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 218.51.152.106 Message-ID: <422d9caa@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1110285482 218.51.152.106 (8 Mar 2005 04:38:02 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail