diff --git a/reactos/subsys/system/explorer/shell/mainframe.cpp b/reactos/subsys/system/explorer/shell/mainframe.cpp index 41522813717..e22e3d94cd1 100644 --- a/reactos/subsys/system/explorer/shell/mainframe.cpp +++ b/reactos/subsys/system/explorer/shell/mainframe.cpp @@ -611,7 +611,7 @@ int MainFrame::Command(int id, int code) break;} case ID_WEB_WINDOW: - create_webchildwindow(_hmdiclient, WebChildWndInfo(TEXT("http://www.reactos.com"))); //@@ + create_webchildwindow(_hmdiclient, WebChildWndInfo(TEXT("http://localhost"))); // http://www.reactos.com //@@ break; ///@todo There are even more menu items! diff --git a/reactos/subsys/system/explorer/shell/webchild.cpp b/reactos/subsys/system/explorer/shell/webchild.cpp index 03ef088b138..9ef483b64a9 100644 --- a/reactos/subsys/system/explorer/shell/webchild.cpp +++ b/reactos/subsys/system/explorer/shell/webchild.cpp @@ -190,7 +190,7 @@ WebChildWindow::WebChildWindow(HWND hwnd, const WebChildWndInfo& info) _evt_handler1(NULL), _evt_handler2(NULL) { - // first try to create MS IE web control + // first try to create a web control with MS IE's CLASSID HRESULT hr = create_control(hwnd, CLSID_WebBrowser, IID_IWebBrowser2); // If this failed, try to use Mozilla's web control @@ -220,3 +220,23 @@ WebChildWindow::~WebChildWindow() delete _evt_handler2; delete _evt_handler1; } + +LRESULT WebChildWindow::WndProc(UINT message, WPARAM wparam, LPARAM lparam) +{ + if (message == WM_ERASEBKGND) { + if (!_control) { + HDC hdc = (HDC)wparam; + ClientRect rect(_hwnd); + + HBRUSH hbrush = CreateSolidBrush(RGB(200,200,235)); + BkMode mode(hdc, TRANSPARENT); + TextColor color(hdc, RGB(200,40,40)); + FillRect(hdc, &rect, hbrush); + DrawText(hdc, TEXT("Sorry - no web browser control could be loaded."), -1, &rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE); + DeleteObject(hbrush); + } + + return TRUE; + } else + return super::WndProc(message, wparam, lparam); +} diff --git a/reactos/subsys/system/explorer/shell/webchild.h b/reactos/subsys/system/explorer/shell/webchild.h index c5b51d6e300..882ee566a94 100644 --- a/reactos/subsys/system/explorer/shell/webchild.h +++ b/reactos/subsys/system/explorer/shell/webchild.h @@ -1361,4 +1361,6 @@ struct WebChildWindow : public IPCtrlWindow protected: DWebBrowserEventsHandler* _evt_handler1; DWebBrowserEvents2Handler* _evt_handler2; + + LRESULT WndProc(UINT message, WPARAM wparam, LPARAM lparam); };