00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00021
00022
00023
00024 #include "stdafx.h"
00025
00026 #include "HtmlView.h"
00027 #include "HtmlFrm.h"
00028
00029 CHtmlView::CHtmlView(CHtmlFrame *pParentFrame) :
00030 m_pParentFrame(pParentFrame)
00031 {
00032 }
00033
00034 BOOL CHtmlView::PreTranslateMessage(MSG *pMsg)
00035 {
00036 if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) &&
00037 (pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST))
00038 return FALSE;
00039
00040
00041 return (BOOL)SendMessage(WM_FORWARDMSG, 0, (LPARAM)pMsg);
00042 }
00043 void CHtmlView::OnFinalMessage(HWND )
00044 {
00045 delete this;
00046 }
00047
00048 LRESULT CHtmlView::OnCreate(UINT , WPARAM , LPARAM , BOOL& bHandled)
00049 {
00050
00051 LRESULT nResult = DefWindowProc();
00052
00053
00054
00055
00056
00057
00058
00059 bHandled = TRUE;
00060 return nResult;
00061 }
00062
00063 LRESULT CHtmlView::OnDestroy(UINT , WPARAM , LPARAM , BOOL& bHandled)
00064 {
00065
00066
00067
00068
00069
00070 bHandled = FALSE;
00071 return 0;
00072 }
00073
00074
00077
00078 HRESULT CHtmlView::get_Control(IUnknown** ppControl)
00079 {
00080 if(m_hWnd != NULL) {
00081 return CAxWindow::QueryControl(ppControl);
00082 }
00083 return NULL;
00084 }
00085
00086 HRESULT CHtmlView::get_Browser(IWebBrowser2** ppBrowser)
00087 {
00088 if(m_hWnd != NULL) {
00089 return CAxWindow::QueryControl(ppBrowser);
00090 }
00091 return NULL;
00092 }