Click here to Skip to main content
15,896,359 members
Articles / Desktop Programming / MFC

How to customize the context menus of a WebBrowser control via the IDocHostUIHandler interface.

Rate me:
Please Sign up or sign in to vote.
4.93/5 (46 votes)
27 Oct 2003CPOL24 min read 543.9K   12.4K   132  
This article describes how we can customize the contextual menus of the WebBrowser control, by implementing the IDocHostUIHandler.
// WebBrowser.h : main header file for the WEBBROWSER application
//

#if !defined(AFX_WEBBROWSER_H__85E3AD63_FAC1_4025_AD55_AE13994EE8F4__INCLUDED_)
#define AFX_WEBBROWSER_H__85E3AD63_FAC1_4025_AD55_AE13994EE8F4__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifndef __AFXWIN_H__
	#error include 'stdafx.h' before including this file for PCH
#endif

#include "resource.h"       // main symbols

/////////////////////////////////////////////////////////////////////////////
// CWebBrowserApp:
// See WebBrowser.cpp for the implementation of this class
//

class CWebBrowserApp : public CWinApp
{
public:
	CWebBrowserApp();
	virtual ~CWebBrowserApp();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CWebBrowserApp)
	public:
	virtual BOOL InitInstance();
	//}}AFX_VIRTUAL

// Implementation
protected:
#ifdef _DEBUG
	CMemoryState	*m_memState;
#endif

public:
	//{{AFX_MSG(CWebBrowserApp)
	afx_msg void OnAppAbout();
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};


/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_WEBBROWSER_H__85E3AD63_FAC1_4025_AD55_AE13994EE8F4__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Greece Greece
I live in Greece with my wife and our two daughters. I am a professional software developer since 1999, using mostly C/C++ in my work.

My main expertise are: C/C++, STL, software optimization, generic programming and debugging. I am also very experienced in client–server programming, communications, concurrent programming, software security and cryptography. Finally, in my early professional years, I have worked a lot on cross-platform programming (Mac+Win).

I am familiar with the MFC, wxWidgets and Cplat GUI frameworks and the Python, Java, Pascal, Fortran, Prolog and Rexx programming languages.

Comments and Discussions