Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

HtmlView.cpp

00001 /* QuestDesigner - Open Zelda's Project
00002    Copyright (C) 2003 Kronuz
00003    Copyright (C) 2001/2003 Open Zelda's Project
00004  
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU General Public License
00007    as published by the Free Software Foundation; either version 2
00008    of the License, or (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018 */
00019 
00021 // HtmlView.cpp : implementation of the CHtmlView class
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     // give HTML page a chance to translate this message
00041     return (BOOL)SendMessage(WM_FORWARDMSG, 0, (LPARAM)pMsg);
00042 }
00043 void CHtmlView::OnFinalMessage(HWND /*hWnd*/)
00044 {
00045     delete this;
00046 }
00047 
00048 LRESULT CHtmlView::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
00049 {
00050     // "base::OnCreate"
00051     LRESULT nResult = DefWindowProc();
00052 
00053     //CAxWindow::QueryControl(&m_pBrowser);
00054     //if(m_pBrowser)
00055     //{
00056     //  DispEventAdvise(m_pBrowser, &DIID_DWebBrowserEvents2);
00057     //}
00058 
00059     bHandled = TRUE;
00060     return nResult;
00061 }
00062 
00063 LRESULT CHtmlView::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
00064 {
00065     //if(m_pBrowser)
00066     //{
00067     //  DispEventUnadvise(m_pBrowser, &DIID_DWebBrowserEvents2);
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 }

Generated on Wed Apr 16 19:12:22 2003 for QuestDesigner by doxygen1.2.18