ReactOS  0.4.12-dev-75-g00dd17e
WebChildWindow Struct Reference

encapsulation of Web control in MDI child windows More...

#include <webchild.h>

Inheritance diagram for WebChildWindow:
Collaboration diagram for WebChildWindow:

Public Types

typedef IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > > super
 
typedef DWebBrowserEvents2Impl web_super
 
- Public Types inherited from IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >
typedef ChildWindow super
 
- Public Types inherited from ChildWindow
typedef PreTranslateWindow super
 
- Public Types inherited from PreTranslateWindow
typedef Window super
 
- Public Types inherited from Window
typedef map< HWND, Window * > WindowMap
 
typedef Window *(* CREATORFUNC) (HWND)
 
typedef Window *(* CREATORFUNC_INFO) (HWND, const void *)
 
- Public Types inherited from DWebBrowserEvents2Impl
typedef IComSrvBase< FixedDWebBrowserEvents2, DWebBrowserEvents2Implsuper
 

Public Member Functions

 WebChildWindow (HWND hwnd, const WebChildWndInfo &info)
 
void BeforeNavigate2 (IDispatch *pDisp, const Variant &url, const Variant &flags, const Variant &targetFrameName, const Variant &postData, const Variant &headers, VARIANT_BOOL &cancel)
 
void NavigateComplete2 (IDispatch *pDisp, const Variant &url)
 
void StatusTextChange (const BStr &text)
 
void ProgressChange (long Progress, long ProgressMax)
 
void WindowMove ()
 
void WindowResize ()
 
void WindowActivate ()
 
void PropertyChange (const BStr &Property)
 
void CommandStateChange (long command, bool enable)
 
void DownloadBegin ()
 
void NewWindow2 (IDispatch **ppDisp, VARIANT_BOOL &cancel)
 
void TitleChange (const BStr &text)
 
void TitleIconChange (const BStr &text)
 
void FrameBeforeNavigate (const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &cancel)
 
void FrameNavigateComplete (const BStr &url)
 
void FrameNewWindow (const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &processed)
 
void OnQuit ()
 
void OnVisible (bool Visible)
 
void OnToolbar (bool Visible)
 
void OnMenubar (bool Visible)
 
void OnStatusbar (bool Visible)
 
void OnFullscreen (bool Visible)
 
void DocumentComplete ()
 
void OnTheatermode (bool Visible)
 
void OnAddressbar (bool Visible)
 
void WindowSetResizable (bool Visible)
 
void WindowClosing (VARIANT_BOOL IsChildWindow, VARIANT_BOOL &cancel)
 
void WindowSetLeft (long Left)
 
void WindowSetTop (long Top)
 
void WindowSetWidth (long Width)
 
void WindowSetHeight (long Height)
 
void ClientToHostWindow (long &CX, long &CY)
 
void SetSecureLockIcon (long SecureLockIcon)
 
void FileDownload (Variant &cancel)
 
void NavigateError (IDispatch *pDisp, const Variant &url, const Variant &Frame, const Variant &StatusCode, VARIANT_BOOL &cancel)
 
void PrivacyImpactedStateChange (bool bImpacted)
 
- Public Member Functions inherited from IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >
 IPCtrlWindow (HWND hwnd)
 
 IPCtrlWindow (HWND hwnd, T &info)
 
HRESULT create_control (HWND hwnd, REFIID clsid, REFIID riid)
 
- Public Member Functions inherited from ChildWindow
 ChildWindow (HWND hwnd, const ChildWndInfo &info)
 
bool go_to (LPCTSTR url)
 
- Public Member Functions inherited from PreTranslateWindow
 PreTranslateWindow (HWND)
 
 ~PreTranslateWindow ()
 
- Public Member Functions inherited from Window
 Window (HWND hwnd)
 
virtual ~Window ()
 
LRESULT SendParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
LRESULT PostParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
- Public Member Functions inherited from DWebBrowserEvents2Impl
 DWebBrowserEvents2Impl (BrowserNavigator &navigator)
 
STDMETHOD() GetTypeInfoCount (UINT *pctinfo)
 
STDMETHOD() GetTypeInfo (UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
STDMETHOD() GetIDsOfNames (REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
STDMETHOD() Invoke (DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS __RPC_FAR *pDispParams, VARIANT __RPC_FAR *pVarResult, EXCEPINFO __RPC_FAR *pExcepInfo, UINT __RPC_FAR *puArgErr)
 
- Public Member Functions inherited from IComSrvBase< FixedDWebBrowserEvents2, DWebBrowserEvents2Impl >
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
- Public Member Functions inherited from IComSrvQI< FixedDWebBrowserEvents2 >
 IComSrvQI (REFIID uuid_base)
 
STDMETHODIMP QueryInterface (REFIID riid, LPVOID *ppv)
 
- Public Member Functions inherited from SimpleComObject
ULONG IncRef ()
 
ULONG DecRef ()
 
- Public Member Functions inherited from DWebBrowserEvents2IF
virtual ~DWebBrowserEvents2IF ()
 
virtual void DownloadComplete ()
 

Static Public Member Functions

static WebChildWindowcreate (const FileChildWndInfo &info)
 
- Static Public Member Functions inherited from ChildWindow
static ChildWindowcreate (const ChildWndInfo &info, const RECT &rect, CREATORFUNC_INFO creator, LPCTSTR classname, LPCTSTR title=NULL, DWORD style=0)
 
- Static Public Member Functions inherited from Window
static HWND Create (CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static HWND Create (CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static Windowcreate_mdi_child (const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator)
 
static LRESULT CALLBACK WindowWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR CALLBACK DialogProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static Windowget_window (HWND hwnd)
 get window controller from window handle More...
 
template<typename CLASS >
static CLASS * get_window (HWND hwnd)
 
static void register_pretranslate (HWND hwnd)
 
static void unregister_pretranslate (HWND hwnd)
 
static BOOL pretranslate_msg (LPMSG pmsg)
 
static void register_dialog (HWND hwnd)
 
static void unregister_dialog (HWND hwnd)
 
static BOOL dispatch_dialog_msg (LPMSG pmsg)
 
static int MessageLoop ()
 
static void CancelModes ()
 

Protected Member Functions

LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual String jump_to_int (LPCTSTR url)
 
- Protected Member Functions inherited from IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >
LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
- Protected Member Functions inherited from ChildWindow
virtual void resize_children (int cx, int cy)
 
void set_url (LPCTSTR url)
 
- Protected Member Functions inherited from Window
virtual LRESULT Init (LPCREATESTRUCT pcs)
 
virtual int Command (int id, int code)
 
virtual int Notify (int id, NMHDR *pnmh)
 
- Protected Member Functions inherited from IComSrvBase< FixedDWebBrowserEvents2, DWebBrowserEvents2Impl >
 IComSrvBase (REFIID uuid_base)
 
- Protected Member Functions inherited from IComSrvQI< FixedDWebBrowserEvents2 >
 IComSrvQI ()
 
virtual ~IComSrvQI ()
 
- Protected Member Functions inherited from ComSrvObject
 ComSrvObject ()
 
virtual ~ComSrvObject ()
 

Protected Attributes

BrowserNavigator _navigator
 
auto_ptr< EventConnector_connector
 
- Protected Attributes inherited from IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >
ComInit _usingCOM
 
SIfacePtr< IWebBrowser2 > _control
 
OleInPlaceClient _client_side
 
SIfacePtr< IOleInPlaceObject_in_place_object
 
- Protected Attributes inherited from ChildWindow
MenuInfo_menu_info
 
WindowHandle _left_hwnd
 
WindowHandle _right_hwnd
 
int _focus_pane
 
int _split_pos
 
int _last_split
 
HWND _hwndFrame
 
String _statusText
 
String _url
 
stack< String_url_history
 
- Protected Attributes inherited from DWebBrowserEvents2Impl
BrowserNavigator_navigator
 
- Protected Attributes inherited from IComSrvQI< FixedDWebBrowserEvents2 >
REFIID _uuid_base
 
- Protected Attributes inherited from ComSrvObject
ULONG _ref
 

Additional Inherited Members

- Public Attributes inherited from Window
IAccessible IAccessible_iface
 
IOleWindow IOleWindow_iface
 
IEnumVARIANT IEnumVARIANT_iface
 
LONG ref
 
- Public Attributes inherited from DWebBrowserEvents2Impl
DWebBrowserEvents2IF_callback
 
- Static Protected Member Functions inherited from Window
static Windowcreate_controller (HWND hwnd)
 create controller for a new window More...
 
static StaticWindowDataGetStaticWindowData ()
 
static LRESULT CALLBACK MDICBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK PropSheetCBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
- Static Protected Attributes inherited from Window
static WindowMap s_wnd_map
 
static const voids_new_info = NULL
 
static CREATORFUNC s_window_creator = NULL
 
static HHOOK s_hcbtHook = 0
 
static WindowSet s_pretranslate_windows
 
static WindowSet s_dialogs
 

Detailed Description

encapsulation of Web control in MDI child windows

Definition at line 834 of file webchild.h.

Member Typedef Documentation

◆ super

Definition at line 837 of file webchild.h.

◆ web_super

Definition at line 838 of file webchild.h.

Constructor & Destructor Documentation

◆ WebChildWindow()

WebChildWindow::WebChildWindow ( HWND  hwnd,
const WebChildWndInfo info 
)

Definition at line 189 of file webchild.cpp.

190  : super(hwnd, info),
192 {
193  // first try to create a web control with MS IE's CLASSID
194  HRESULT hr = create_control(hwnd, CLSID_WebBrowser, IID_IWebBrowser2);
195 
196  // If this failed, try to use Mozilla's web control
197  if (FAILED(hr))
198  hr = create_control(hwnd, CLSID_MozillaBrowser, IID_IWebBrowser2);
199 
200  if (SUCCEEDED(hr)) {
202 
203  _connector = auto_ptr<EventConnector>(new EventConnector(_control, DIID_DWebBrowserEvents2, this));
204 
205  _control->Navigate(BStr(info._path), &vtMissing, &vtMissing, &vtMissing, &vtMissing);
206  //browser->Navigate2(&Variant(info._path), &vtMissing, &vtMissing, &vtMissing, &vtMissing);
207  }
208 }
void attach(IWebBrowser *browser)
Definition: webchild.cpp:104
_variant_t vtMissing(DISP_E_PARAMNOTFOUND, VT_ERROR)
LPCTSTR _path
Definition: filechild.h:37
HRESULT create_control(HWND hwnd, REFIID clsid, REFIID riid)
Definition: webchild.h:335
static const CLSID CLSID_MozillaBrowser
Definition: webchild.cpp:185
BrowserNavigator _navigator
Definition: webchild.h:1012
LONG HRESULT
Definition: typedefs.h:77
DWebBrowserEvents2Impl web_super
Definition: webchild.h:838
auto_ptr< EventConnector > _connector
Definition: webchild.h:1013
IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > > super
Definition: webchild.h:837
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Member Function Documentation

◆ BeforeNavigate2()

void WebChildWindow::BeforeNavigate2 ( IDispatch pDisp,
const Variant &  url,
const Variant &  flags,
const Variant &  targetFrameName,
const Variant &  postData,
const Variant &  headers,
VARIANT_BOOL cancel 
)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 853 of file webchild.h.

856  {
857  //String adr = (BStr)url;
858  }

◆ ClientToHostWindow()

void WebChildWindow::ClientToHostWindow ( long CX,
long CY 
)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 990 of file webchild.h.

991  {
992  }

◆ CommandStateChange()

void WebChildWindow::CommandStateChange ( long  command,
bool  enable 
)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 895 of file webchild.h.

896  {
897  }

◆ create()

static WebChildWindow* WebChildWindow::create ( const FileChildWndInfo info)
inlinestatic

Definition at line 842 of file webchild.h.

Referenced by create_webchildwindow().

843  {
846 
847  return static_cast<WebChildWindow*>(child);
848  }
#define SW_SHOWMAXIMIZED
Definition: winuser.h:767
static HWND child
Definition: cursoricon.c:298
#define CLASSNAME_CHILDWND
Definition: explorer.h:75
smooth NULL
Definition: ftsmooth.c:416
#define WINDOW_CREATOR_INFO(WND_CLASS, INFO_CLASS)
Definition: window.h:215
information structure for creation of WebChildWindow
Definition: filechild.h:79
static ChildWindow * create(const ChildWndInfo &info, const RECT &rect, CREATORFUNC_INFO creator, LPCTSTR classname, LPCTSTR title=NULL, DWORD style=0)
Definition: window.cpp:369
RECT rcNormalPosition
Definition: winuser.h:3237
encapsulation of Web control in MDI child windows
Definition: webchild.h:834
WINDOWPLACEMENT _pos
Definition: filechild.h:39
#define WS_MAXIMIZE
Definition: pedump.c:623

◆ DocumentComplete()

void WebChildWindow::DocumentComplete ( )
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 954 of file webchild.h.

955  {
956  }

◆ DownloadBegin()

void WebChildWindow::DownloadBegin ( )
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 899 of file webchild.h.

900  {
901  }

◆ FileDownload()

void WebChildWindow::FileDownload ( Variant &  cancel)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 998 of file webchild.h.

999  {
1000  }

◆ FrameBeforeNavigate()

void WebChildWindow::FrameBeforeNavigate ( const BStr &  url,
long  flags,
const BStr &  targetFrameName,
VARIANT postData,
const BStr &  headers,
VARIANT_BOOL cancel 
)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 918 of file webchild.h.

919  {
920  }

◆ FrameNavigateComplete()

void WebChildWindow::FrameNavigateComplete ( const BStr &  url)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 922 of file webchild.h.

923  {
924  }

◆ FrameNewWindow()

void WebChildWindow::FrameNewWindow ( const BStr &  url,
long  flags,
const BStr &  targetFrameName,
VARIANT postData,
const BStr &  headers,
VARIANT_BOOL processed 
)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 926 of file webchild.h.

927  {
928  }

◆ jump_to_int()

String WebChildWindow::jump_to_int ( LPCTSTR  url)
protectedvirtual

Implements ChildWindow.

Definition at line 284 of file webchild.cpp.

285 {
287 
288  return url;
289 }
void goto_url(LPCTSTR url)
Definition: webchild.cpp:109
BrowserNavigator _navigator
Definition: webchild.h:1012
static const WCHAR url[]
Definition: encode.c:1432

◆ NavigateComplete2()

void WebChildWindow::NavigateComplete2 ( IDispatch pDisp,
const Variant &  url 
)
inlinevirtual

Reimplemented from DWebBrowserEvents2Impl.

Definition at line 860 of file webchild.h.

861  {
863 
864  set_url(String(BStr(url)));
865  }
static WCHAR String[]
Definition: stringtable.c:55
static const WCHAR url[]
Definition: encode.c:1432
void NavigateComplete2(IDispatch *pDisp, const Variant &url)
Definition: webchild.h:824
void set_url(LPCTSTR url)
Definition: window.cpp:567

◆ NavigateError()

void WebChildWindow::NavigateError ( IDispatch pDisp,
const Variant &  url,
const Variant &  Frame,
const Variant &  StatusCode,
VARIANT_BOOL cancel 
)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 1002 of file webchild.h.

1003  {
1004  }

◆ NewWindow2()

void WebChildWindow::NewWindow2 ( IDispatch **  ppDisp,
VARIANT_BOOL cancel 
)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 903 of file webchild.h.

904  {
905  //*ppDisp = ;
906  //cancel = TRUE;
907  }

◆ OnAddressbar()

void WebChildWindow::OnAddressbar ( bool  Visible)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 962 of file webchild.h.

963  {
964  }

◆ OnFullscreen()

void WebChildWindow::OnFullscreen ( bool  Visible)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 950 of file webchild.h.

951  {
952  }

◆ OnMenubar()

void WebChildWindow::OnMenubar ( bool  Visible)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 942 of file webchild.h.

943  {
944  }

◆ OnQuit()

void WebChildWindow::OnQuit ( )
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 930 of file webchild.h.

931  {
932  }

◆ OnStatusbar()

void WebChildWindow::OnStatusbar ( bool  Visible)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 946 of file webchild.h.

947  {
948  }

◆ OnTheatermode()

void WebChildWindow::OnTheatermode ( bool  Visible)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 958 of file webchild.h.

959  {
960  }

◆ OnToolbar()

void WebChildWindow::OnToolbar ( bool  Visible)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 938 of file webchild.h.

939  {
940  }

◆ OnVisible()

void WebChildWindow::OnVisible ( bool  Visible)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 934 of file webchild.h.

935  {
936  }

◆ PrivacyImpactedStateChange()

void WebChildWindow::PrivacyImpactedStateChange ( bool  bImpacted)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 1006 of file webchild.h.

1007  {
1008  }

◆ ProgressChange()

void WebChildWindow::ProgressChange ( long  Progress,
long  ProgressMax 
)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 873 of file webchild.h.

874  {
875  }

◆ PropertyChange()

void WebChildWindow::PropertyChange ( const BStr &  Property)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 889 of file webchild.h.

890  {
891  Variant value;
892  _control->GetProperty(Property, &value);
893  }
GLsizei const GLfloat * value
Definition: glext.h:6069

◆ SetSecureLockIcon()

void WebChildWindow::SetSecureLockIcon ( long  SecureLockIcon)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 994 of file webchild.h.

995  {
996  }

◆ StatusTextChange()

void WebChildWindow::StatusTextChange ( const BStr &  text)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 867 of file webchild.h.

868  {
869  _statusText = text;
871  }
HWND _hwndFrame
Definition: window.h:331
const WCHAR * text
Definition: package.c:1827
String _statusText
Definition: window.h:332
LONG_PTR LPARAM
Definition: windef.h:208
#define PM_SETSTATUSTEXT
Definition: window.h:340
#define SendMessage
Definition: winuser.h:5709

◆ TitleChange()

void WebChildWindow::TitleChange ( const BStr &  text)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 909 of file webchild.h.

910  {
911  SetWindowText(_hwnd, String(text));
912  }
const WCHAR * text
Definition: package.c:1827
static WCHAR String[]
Definition: stringtable.c:55
#define SetWindowText
Definition: winuser.h:5723

◆ TitleIconChange()

void WebChildWindow::TitleIconChange ( const BStr &  text)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 914 of file webchild.h.

915  {
916  }

◆ WindowActivate()

void WebChildWindow::WindowActivate ( )
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 885 of file webchild.h.

886  {
887  }

◆ WindowClosing()

void WebChildWindow::WindowClosing ( VARIANT_BOOL  IsChildWindow,
VARIANT_BOOL cancel 
)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 970 of file webchild.h.

971  {
972  }

◆ WindowMove()

void WebChildWindow::WindowMove ( )
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 877 of file webchild.h.

878  {
879  }

◆ WindowResize()

void WebChildWindow::WindowResize ( )
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 881 of file webchild.h.

882  {
883  }

◆ WindowSetHeight()

void WebChildWindow::WindowSetHeight ( long  Height)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 986 of file webchild.h.

987  {
988  }

◆ WindowSetLeft()

void WebChildWindow::WindowSetLeft ( long  Left)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 974 of file webchild.h.

975  {
976  }

◆ WindowSetResizable()

void WebChildWindow::WindowSetResizable ( bool  Visible)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 966 of file webchild.h.

967  {
968  }

◆ WindowSetTop()

void WebChildWindow::WindowSetTop ( long  Top)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 978 of file webchild.h.

979  {
980  }

◆ WindowSetWidth()

void WebChildWindow::WindowSetWidth ( long  Width)
inlinevirtual

Reimplemented from DWebBrowserEvents2IF.

Definition at line 982 of file webchild.h.

983  {
984  }

◆ WndProc()

LRESULT WebChildWindow::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)
protectedvirtual
Todo:

Reimplemented from Window.

Definition at line 210 of file webchild.cpp.

211 {
212  try {
213  switch(nmsg) {
214  case WM_ERASEBKGND:
215  if (!_control) {
216  HDC hdc = (HDC)wparam;
217  ClientRect rect(_hwnd);
218 
219  HBRUSH hbrush = CreateSolidBrush(RGB(200,200,235));
220  BkMode mode(hdc, TRANSPARENT);
221  TextColor color(hdc, RGB(200,40,40));
222  FillRect(hdc, &rect, hbrush);
223  DrawText(hdc, TEXT("Sorry - no web browser control could be loaded."), -1, &rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE);
224  DeleteObject(hbrush);
225  }
226 
227  return TRUE;
228 
229  case PM_DISPATCH_COMMAND: {
230  if (!_control)
231  return FALSE;
232 
233  HRESULT hr = E_FAIL;
234 
235  switch(LOWORD(wparam)) {
236  case ID_GO_BACK:
237  hr = _control->GoBack();
238  break;
239 
240  case ID_GO_FORWARD:
241  hr = _control->GoForward();
242  break;
243 
244  case ID_GO_UP:
246  break;
247 
248  case ID_GO_HOME:
249  hr = _control->GoHome();
250  break;
251 
252  case ID_GO_SEARCH:
253  hr = _control->GoSearch();
254  break;
255 
256  case ID_REFRESH:
257  hr = _control->Refresh();
258  break;
259 
260  case ID_STOP:
261  hr = _control->Stop();
262  break;
263 
264  default:
265  return super::WndProc(nmsg, wparam, lparam);
266  }
267 
268  if (FAILED(hr) && hr!=E_FAIL)
269  THROW_EXCEPTION(hr);
270 
271  return TRUE;}
272 
273  default:
274  return super::WndProc(nmsg, wparam, lparam);
275  }
276  } catch(COMException& e) {
277  HandleException(e, _hwnd);
278  }
279 
280  return 0;
281 }
#define HDC
Definition: msvc.h:22
#define THROW_EXCEPTION(hr)
Definition: shellclasses.h:161
#define TRUE
Definition: types.h:120
#define ID_REFRESH
Definition: resource.h:18
static HBRUSH hbrush
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define E_FAIL
Definition: ddrawi.h:102
#define ID_GO_UP
Definition: resource.h:210
& rect
Definition: startmenu.cpp:1413
#define DrawText
Definition: winuser.h:5637
Exception with context information.
Definition: shellclasses.h:113
GLuint color
Definition: glext.h:6243
#define e
Definition: ke_i.h:82
#define TRANSPARENT
Definition: wingdi.h:948
HDC hdc
Definition: msvc.h:53
#define DT_VCENTER
Definition: winuser.h:543
void HandleException(COMException &e, HWND hwnd)
Exception Handler for COM exceptions.
LONG HRESULT
Definition: typedefs.h:77
#define RGB(r, g, b)
Definition: wingdi.h:2917
GLenum mode
Definition: glext.h:6217
UINT WPARAM LPARAM lparam
Definition: msvc.h:92
#define ID_GO_SEARCH
Definition: resource.h:209
#define DT_SINGLELINE
Definition: winuser.h:540
#define TEXT(s)
Definition: k32.h:26
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: webchild.h:354
#define ID_GO_HOME
Definition: resource.h:208
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define ID_GO_FORWARD
Definition: resource.h:207
#define DT_CENTER
Definition: winuser.h:527
#define WM_ERASEBKGND
Definition: winuser.h:1607
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
#define PM_DISPATCH_COMMAND
Definition: window.h:265
#define LOWORD(l)
Definition: pedump.c:82
#define ID_STOP
Definition: resource.h:21
UINT WPARAM wparam
Definition: msvc.h:92
#define ID_GO_BACK
Definition: resource.h:206

Member Data Documentation

◆ _connector

auto_ptr<EventConnector> WebChildWindow::_connector
protected

Definition at line 1013 of file webchild.h.

Referenced by WebChildWindow().

◆ _navigator

BrowserNavigator WebChildWindow::_navigator
protected

Definition at line 1012 of file webchild.h.

Referenced by jump_to_int(), and WebChildWindow().


The documentation for this struct was generated from the following files: