Click here to Skip to main content
15,885,216 members
Articles / Desktop Programming / WTL

WTL Browser

Rate me:
Please Sign up or sign in to vote.
4.68/5 (23 votes)
23 May 20046 min read 164K   5.8K   64  
How to create a simple browser using IE engine and WTL.
// WTLBrowserView.h : interface of the CWTLBrowserView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_WTLBROWSERVIEW_H__27BEDF70_F34D_4698_A226_534A3D32E98B__INCLUDED_)
#define AFX_WTLBROWSERVIEW_H__27BEDF70_F34D_4698_A226_534A3D32E98B__INCLUDED_

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

#include "Browser.h"

class CWTLBrowserView : public CWindowImpl<CWTLBrowserView, CAxWindow>, public CWebBrowser2<CWTLBrowserView>
{
public:
	CWTLBrowserView(CEdit& URL,CMultiPaneStatusBarCtrl& StatusBar) : m_URL(URL), m_StatusBar(StatusBar), m_bSecured(FALSE)
	{
	}
	
	DECLARE_WND_SUPERCLASS(NULL, CAxWindow::GetWndClassName())

	BOOL PreTranslateMessage(MSG* pMsg);

	BEGIN_MSG_MAP(CWTLBrowserView)
		CHAIN_MSG_MAP(CWebBrowser2<CWTLBrowserView>)
	END_MSG_MAP()

// Handler prototypes (uncomment arguments if needed):
//	LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
//	LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
//	LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)

	void OnNavigateComplete2(IDispatch* pDisp, const String& szURL);
	void OnStatusTextChange(const String& szText);
	void OnProgressChange(long nProgress, long nProgressMax);
	void OnSetSecureLockIcon(long nSecureLockIcon);

	BOOL IsSecured() const
	{
		return m_bSecured;
	}

protected:
	CEdit& m_URL;
	CMultiPaneStatusBarCtrl& m_StatusBar;
	BOOL m_bSecured;
};


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

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

#endif // !defined(AFX_WTLBROWSERVIEW_H__27BEDF70_F34D_4698_A226_534A3D32E98B__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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Israel Israel
Gilad was born accidently to a pair of old lesbians. His childhood was full of vibrators and drugs. Married without kids. Has 14 grandsons around the world, 4 crocodiles, 2 mushrooms and a green alien living behind the refrigerator.

Hobbies: Watching hardcore porn, sculpturing with snot, skydiving from stairs.

Check my Homepage for additional resources.

Quote: "There's always one more bug"

Comments and Discussions