Jump to content
  • Advertisement
Sign in to follow this  

[solved] Microsoft Webbrowser activex plugin in pure MFC program (3d border).

This topic is 4510 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all. Me and some more have been pulling our hair on how to remove the 3d border in the activex plugin for the microsoft webbrowser. ( see here : image of application ), the gray border. We have a pure MFC program (no .net or anything), and according to M$ to remove that border we have to do something with IDocHostUIHandler and such, but since we dont use a .net dialog application we cant do that (it seems), or atleast there is no info on how to do it in a pure MFC application. Another guy talked about something with doing
    int exstyle = GetWindowLong(m_wb , GWL_EXstyle);
    exstyle = exstyle & (~WS_EX_CLIENTEDGE);
    SetWindowLong(m_wb, GWL_EXstyle, exstyle);

But, that wont work aswell, or atleast we never got it to work. So, anyone got a clue on how to remove that border ? The names used : IDC_EXPLORER2 CExplorer2 m_wb; // the name for explorer eg. to do m_wb.Navigate (strURL, COleVariant((long) 0, VT_I4), empty, empty, empty); Anyways, HELP !!! lol... please :) [Edited by - NightMarez on June 18, 2006 9:21:32 AM]

Share this post

Link to post
Share on other sites
there is some info here, but i dont know how to implement them.


one of them wich is
Remove the Border
To remove the borders, use one of following methods:
• Post a user-defined message, and then perform the navigation in the user-defined message handler.


• Follow the steps in Microsoft Knowledge Base article Q196835 to provide the custom control site in which you can add the IDocHostUIHandler interface.

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
196835 (http://support.microsoft.com/kb/196835/EN-US/) HOWTO: Override the MFC Default Control Containment

After you implement all the functions, you must add DOCHOSTUIFLAG_NO3DBORDER to the DOCHOSTUIINFO stucture in the dwFlags field for the GetHostInfo method. It is beyond the scope of this article to provide the steps to implement IDocHostUIHandler.

NOTE: The border problem does not appear in an Active Template Library (ATL) container because the ATL class, CAxHostWindow, already implements the IDocHostUIHandler interface. By default, CAxHostWindow enables this flag.

1) dunno how to post a userdefined msg to this.
2) i cant seem to find the COle lala stuff in VS.net 2003 as descriped in the thing about rewriting the custom control site.

help would be GREATLY appriciatet as i have pondered over this in 3 days now.

Share this post

Link to post
Share on other sites
okay i found the sollution, and since apparently noone else knows, ill post here how for others in the same situation.

FIRST, you cannot do this with the MS 2003 SDK (rev1), you NEED to upgrade to MS 2003 SDK (rev2).

then simply do as :


however, in the lines it say (for all files) :

#include <..\src\occimpl.h>

replace with

#if (_MFC_VER < 0x0700)
#include <..\src\occimpl.h> // For COccManager
#include <afxocc.h>

thats it, border is gone :)


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!