Disabling the right mouse button

I have an application that calls a COM (Component Object Model - like an Ole or an Active-X control) that I did not compile and therefore cannot change.  I am satisfied with everything the COM does in response to events from the keyboard or the mouse except when the right-mouse button is cliked.  Is there any way I can disable this button or make this button appear to be a left button so that a right-mouse button event will never be sent to the COM, but the left mouse button and keyboard events can be sent to the COM?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Juan_DiegoAuthor Commented:
Edited text of question.
What do you mean by "a COM"?
Juan_DiegoAuthor Commented:
Edited text of question.
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

With the classwizzard enable the WM_RBUTTONDOWN
code for the view that you're working with and simply
keep it empty.

This should enable you to not trigger or trigger you're own code
because this will trigger before the other code.

If the COM Object is in itself a view, then aggregate or contain the COM interface and overload the mouse right button function
this should also help but is a bit more tricky.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Juan_DiegoAuthor Commented:
Enabling the WM_RBUTTONDOWN did not work because the COM handles the input.  I was only able to get the enabled WM_RBUTTON function to work when I called SetCapture to allow my own view class to handle input, but then no other input (for example the left-mouse button) was sent to the COM.

More specifically, I am trying to make a browser that does not allow the user access to the options that come from Right-mouse clicking the page (such as View Source etc.).  I created a browser by simply picking CHtmlView as the view class instead of CView.  The CHtmlView class has a function Navigate2 which causes the browser to go to the URL passed to the function as an argument. In the code that they provide for us in the Navigate2 function, the COM m_pBrowser is called as follows:

      m_pBrowserApp->Navigate2(vURL, vFlags, vTargetFrameName,
            vPostData, vHeaders);

I am not familar with how to contain and overload COM's.  How could I overload the com m_pBrowserApp?
A host can replace the menus, toolbars, and context menus used by IE4 by implementing the IDocHostUIHandler interface.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.