Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how can i overwrite IDocHostUIHandler::ShowContextMenu()

how can i overwrite IDocHostUIHandler::ShowContextMenu()

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studiocomtutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    only_jack
    wrote on last edited by
    #1

    hi i have a dialog based MFC application with a web browser control i have created it dynamicaly with CWnd wrapper class i am creating control like below and i want to control contex menu of the web browser

    int CHolderWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
    {
    if (CWnd::OnCreate(lpCreateStruct) == -1)
    return -1;

    DWORD dwStyle = WS\_CHILD|WS\_VISIBLE;
    
    m\_pWebCtrl = new CWebBrowser2;
    if(!m\_pWebCtrl->Create(NULL,NULL,dwStyle,CRect(0,0,0,0),this,ID\_WEB\_WINDOW))
    {
    	return -1;
    }
    
    return 0;
    

    }

    after some search i found this link http://msdn.microsoft.com/en-us/library/aa770042(VS.85).aspx[^] but i do not know how to use it can you give me a clue about how to start this task thank you

    S 1 Reply Last reply
    0
    • O only_jack

      hi i have a dialog based MFC application with a web browser control i have created it dynamicaly with CWnd wrapper class i am creating control like below and i want to control contex menu of the web browser

      int CHolderWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
      {
      if (CWnd::OnCreate(lpCreateStruct) == -1)
      return -1;

      DWORD dwStyle = WS\_CHILD|WS\_VISIBLE;
      
      m\_pWebCtrl = new CWebBrowser2;
      if(!m\_pWebCtrl->Create(NULL,NULL,dwStyle,CRect(0,0,0,0),this,ID\_WEB\_WINDOW))
      {
      	return -1;
      }
      
      return 0;
      

      }

      after some search i found this link http://msdn.microsoft.com/en-us/library/aa770042(VS.85).aspx[^] but i do not know how to use it can you give me a clue about how to start this task thank you

      S Offline
      S Offline
      Steve Thresher
      wrote on last edited by
      #2

      I found the following a great help when I was looking at hosting the web browser control. http://www.codeproject.com/KB/COM/cwebpage.aspx[^] I think this is what you need to do: http://msdn.microsoft.com/en-us/library/bb508516(VS.85).aspx#doc_host_UI[^]

      AxisFirst For Business

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups