mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
display nice error message
svn path=/trunk/; revision=8084
This commit is contained in:
parent
73b7358882
commit
77d84e17ca
3 changed files with 24 additions and 2 deletions
|
@ -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!
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -1361,4 +1361,6 @@ struct WebChildWindow : public IPCtrlWindow<ChildWindow, SIfacePtr<IWebBrowser2>
|
|||
protected:
|
||||
DWebBrowserEventsHandler* _evt_handler1;
|
||||
DWebBrowserEvents2Handler* _evt_handler2;
|
||||
|
||||
LRESULT WndProc(UINT message, WPARAM wparam, LPARAM lparam);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue