diff --git a/reactos/subsys/system/explorer/explorer_intres.h b/reactos/subsys/system/explorer/explorer_intres.h index a3b9a289873..831a0b4279d 100644 --- a/reactos/subsys/system/explorer/explorer_intres.h +++ b/reactos/subsys/system/explorer/explorer_intres.h @@ -114,7 +114,7 @@ #define ID_ABOUT_WINEFILE 1705 #define IDC_FILETREE 10001 #define ID_EXPLORER_FAQ 10002 -#define ID_WEB_WINDOW 10003 +#define ID_WEB_WINDOW 10003 #define ID_WINDOW_AUTOSORT 0x8003 #define ID_VIEW_FULLSCREEN 0x8004 #define ID_PREFERED_SIZES 0x8005 @@ -127,7 +127,12 @@ #define ID_DRIVE_FIRST 0x9006 #define ID_ABOUT_WINDOWS 40002 #define ID_ABOUT_EXPLORER 40003 -#define ID_DESKTOPBAR_SETTINGS 40005 +#define ID_DESKTOPBAR_SETTINGS 40004 +#define ID_BROWSE_BACK 40005 +#define ID_BROWSE_FORWARD 40006 +#define ID_BROWSE_HOME 40007 +#define ID_BROWSE_SEARCH 40008 +#define ID_STOP 40009 #define ID_WINDOW_NEW 0xE130 #define ID_WINDOW_ARRANGE 0xE131 #define ID_WINDOW_CASCADE 0xE132 diff --git a/reactos/subsys/system/explorer/res/toolbar.bmp b/reactos/subsys/system/explorer/res/toolbar.bmp index 9a0d13c4c20..632b1ec6750 100644 Binary files a/reactos/subsys/system/explorer/res/toolbar.bmp and b/reactos/subsys/system/explorer/res/toolbar.bmp differ diff --git a/reactos/subsys/system/explorer/shell/mainframe.cpp b/reactos/subsys/system/explorer/shell/mainframe.cpp index e22e3d94cd1..893bfc76985 100644 --- a/reactos/subsys/system/explorer/shell/mainframe.cpp +++ b/reactos/subsys/system/explorer/shell/mainframe.cpp @@ -73,7 +73,15 @@ MainFrame::MainFrame(HWND hwnd) /*TODO {4, ID_... , TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}, {5, ID_... , TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}, -*/ }; +*/ + {0, 0, 0, BTNS_SEP, {0, 0}, 0, 0}, + {7, ID_BROWSE_BACK, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}, + {8, ID_BROWSE_FORWARD, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}, + {9, ID_BROWSE_HOME, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}, + {10, ID_BROWSE_SEARCH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}, + {11, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}, + {12, ID_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}, + }; _htoolbar = CreateToolbarEx(hwnd, WS_CHILD|WS_VISIBLE, IDW_TOOLBAR, 2, g_Globals._hInstance, IDB_TOOLBAR, toolbarBtns, @@ -130,7 +138,7 @@ MainFrame::MainFrame(HWND hwnd) } // insert Registry button - SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)TEXT("Registry\0")); + SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)TEXT("Reg.\0")); drivebarBtn.idCommand = ID_DRIVE_REGISTRY; SendMessage(_hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn); @@ -634,12 +642,6 @@ int MainFrame::Command(int id, int code) break; default: - /*@todo if (wParam >= PM_FIRST_LANGUAGE && wParam <= PM_LAST_LANGUAGE) - STRING_SelectLanguageByNumber(wParam - PM_FIRST_LANGUAGE); - else */if ((id=IDW_FIRST_CHILD+0x100) && - (idSC_RESTORE)) - MessageBox(_hwnd, TEXT("Not yet implemented"), ResString(IDS_TITLE), MB_OK); - #ifndef _NO_MDI return DefFrameProc(_hwnd, _hmdiclient, WM_COMMAND, MAKELONG(id,code), 0); #else diff --git a/reactos/subsys/system/explorer/shell/webchild.cpp b/reactos/subsys/system/explorer/shell/webchild.cpp index 9ef483b64a9..6cf06cede1d 100644 --- a/reactos/subsys/system/explorer/shell/webchild.cpp +++ b/reactos/subsys/system/explorer/shell/webchild.cpp @@ -29,6 +29,8 @@ #include "../utility/utility.h" #include "../explorer.h" +#include "../explorer_intres.h" + #include "webchild.h" //#include @@ -184,7 +186,7 @@ HWND create_webchildwindow(HWND hmdiclient, const WebChildWndInfo& info) static const CLSID CLSID_MozillaBrowser = {0x1339B54C, 0x3453, 0x11D2, {0x93, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}; - + WebChildWindow::WebChildWindow(HWND hwnd, const WebChildWndInfo& info) : super(hwnd), _evt_handler1(NULL), @@ -223,20 +225,68 @@ WebChildWindow::~WebChildWindow() LRESULT WebChildWindow::WndProc(UINT message, WPARAM wparam, LPARAM lparam) { - if (message == WM_ERASEBKGND) { - if (!_control) { - HDC hdc = (HDC)wparam; - ClientRect rect(_hwnd); + try { + switch(message) { + case 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); + 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; + + case PM_DISPATCH_COMMAND: { + if (_control) { + HRESULT hr = E_FAIL; + + switch(LOWORD(wparam)) { + case ID_BROWSE_BACK: + hr = _control->GoBack(); + break; + + case ID_BROWSE_FORWARD: + hr = _control->GoForward(); + break; + + case ID_BROWSE_HOME: + hr = _control->GoHome(); + break; + + case ID_BROWSE_SEARCH: + hr = _control->GoSearch(); + break; + + case ID_REFRESH: + hr = _control->Refresh(); + break; + + case ID_STOP: + hr = _control->Stop(); + break; + + default: + return FALSE; + } + + if (FAILED(hr) && hr!=E_FAIL) + THROW_EXCEPTION(hr); + } + + return TRUE;} + + default: + return super::WndProc(message, wparam, lparam); } + } catch(COMException& e) { + HandleException(e, _hwnd); + } - return TRUE; - } else - return super::WndProc(message, wparam, lparam); + return 0; }