Solved

Removing Custom Context Menu (right click menu)

Posted on 2006-11-21
2
256 Views
Last Modified: 2013-11-20
Hi guys,

I've downloaded this:

http://www.codeproject.com/internet/CustomBrowser.asp

It's probably really simple, but I can't seem to do it...

How would I go about removing the custom context menu (right click menu), and going back to the standard Internet Explorer one?


Cheers guys 'n gals!
0
Comment
Question by:Cyber-Drugs
2 Comments
 
LVL 4

Accepted Solution

by:
bdunz19 earned 500 total points
ID: 17991126
Hi Cyber,

In your Custsite.cpp file locate the CCustomControlSite::XDocHostUIHandler::ShowContextMenu() function. In there you need to comment the following or remove it (you also need to return S_FALSE instead of return S_OK):

HRESULT FAR EXPORT  CCustomControlSite::XDocHostUIHandler::ShowContextMenu(
                        DWORD /*dwID*/,
                        POINT* pptPosition,
                        IUnknown* /*pCommandTarget*/,
                        IDispatch* /*pDispatchObjectHit*/)
{
      METHOD_PROLOGUE(CCustomControlSite, DocHostUIHandler)

// I commented the following and we will let explorer handle this
      //CMenu menu;
      //menu.LoadMenu(IDR_CUSTOM_POPUP);
      //CMenu* pSubMenu = menu.GetSubMenu(0);
      ////Because we passed in theApp.m_pMainWnd all of our
      ////WM_COMMAND handlers for the menu items must be handled
      ////in CCustomBrowserApp. If you want this to be your dialog
      ////you will have to grab a pointer to your dialog class and
      ////pass the hWnd of it into the last parameter in this call
      //pSubMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON, pptPosition->x, pptPosition->y, theApp.m_pMainWnd);

// Return S_FALSE to show that we have not handled this ourselves
    return S_FALSE;
}
0
 
LVL 4

Author Comment

by:Cyber-Drugs
ID: 17995218
I spent ages looking for that, thanks bdunz19! :)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 47
Windows Drag & Drop Location 2 85
Get filename and folder into excel 7 67
pre4 challenge 19 88
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now