Thursday, August 21, 2008

How to disable the default pop-up menu for CHtmlView in MFC

Read the article: http://support.microsoft.com/kb/236312


OR

Just override the CHtmlView::OnShowContextMenu funcion and return S_OK.

HRESULT CWebBrowserView::OnShowContextMenu(DWORD dwID, LPPOINT ppt, LPUNKNOWN pcmdtReserved, LPDISPATCH pdispReserved)

{

return S_OK;

// Don't call the base version

/*return CHtmlView::OnShowContextMenu(DWORD dwID, LPPOINT ppt, LPUNKNOWN pcmdtReserved, LPDISPATCH pdispReserved);*/

}

No comments: