diff --git a/reactos/subsys/system/explorer/shell/filechild.cpp b/reactos/subsys/system/explorer/shell/filechild.cpp index f32e21e3958..b97521934a0 100644 --- a/reactos/subsys/system/explorer/shell/filechild.cpp +++ b/reactos/subsys/system/explorer/shell/filechild.cpp @@ -523,6 +523,13 @@ LRESULT FileChildWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) } break;} + case PM_JUMP_TO: { + LPCTSTR url = (LPCTSTR)lparam; + + if (0) ///@todo + return TRUE; + break;} + default: def: return super::WndProc(nmsg, wparam, lparam); } diff --git a/reactos/subsys/system/explorer/shell/mainframe.cpp b/reactos/subsys/system/explorer/shell/mainframe.cpp index 730a5c60648..c61d0c74fdf 100644 --- a/reactos/subsys/system/explorer/shell/mainframe.cpp +++ b/reactos/subsys/system/explorer/shell/mainframe.cpp @@ -483,7 +483,11 @@ LRESULT MainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) path = buffer; } - { + if (_tcsstr(path, TEXT("://"))) { // "http://...", "ftp://", ... + OBJ_CONTEXT("create WebChild window", path); + + return (LRESULT)GET_WINDOW(ChildWindow, create_webchildwindow(WebChildWndInfo(_hmdiclient, path))); + } else { OBJ_CONTEXT("create ShellChildWndInfo", path); // Shell Namespace as default view @@ -530,8 +534,9 @@ int MainFrame::Command(int id, int code) #ifndef _NO_MDI HWND hwndClient = (HWND) SendMessage(_hmdiclient, WM_MDIGETACTIVE, 0, 0); - if (SendMessage(hwndClient, PM_DISPATCH_COMMAND, MAKELONG(id,code), 0)) - return 0; + if (hwndClient) + if (SendMessage(hwndClient, PM_DISPATCH_COMMAND, MAKELONG(id,code), 0)) + return 0; #endif if (id>=ID_DRIVE_FIRST && id<=ID_DRIVE_FIRST+0xFF) { @@ -792,6 +797,18 @@ int MainFrame::Notify(int id, NMHDR* pnmh) } } break;} + + case NM_DBLCLK: { + HTREEITEM hitem = TreeView_GetSelection(_hsidebar); + LPARAM lparam = TreeView_GetItemData(_hsidebar, hitem); + + if (lparam) { + const BookmarkNode& node = *(BookmarkNode*)lparam; + + if (node._type == BookmarkNode::BMNT_BOOKMARK) + jump_to(node._pbookmark->_url); + } + break;} } return 0; @@ -1073,3 +1090,17 @@ void MainFrame::FillBookmarks() } #endif + + +void MainFrame::jump_to(LPCTSTR url) +{ +#ifndef _NO_MDI + HWND hwndClient = (HWND) SendMessage(_hmdiclient, WM_MDIGETACTIVE, 0, 0); + + if (hwndClient) + if (SendMessage(hwndClient, PM_JUMP_TO, 0, (LPARAM)url)) + return; +#endif + + CreateChild(url); +} diff --git a/reactos/subsys/system/explorer/shell/mainframe.h b/reactos/subsys/system/explorer/shell/mainframe.h index e3b0085b614..37b6f317571 100644 --- a/reactos/subsys/system/explorer/shell/mainframe.h +++ b/reactos/subsys/system/explorer/shell/mainframe.h @@ -29,6 +29,8 @@ #define PM_OPEN_WINDOW (WM_APP+0x07) enum OPEN_WINDOW_MODE {OWM_EXPLORE=1, OWM_DETAILS=2, OWM_PIDL=4}; +#define PM_JUMP_TO (WM_APP+0x25) + /// Explorer frame window struct MainFrame : public PreTranslateWindow @@ -86,6 +88,7 @@ protected: void fullscreen_move(); void FillBookmarks(); + void jump_to(LPCTSTR url); HACCEL _hAccel; TCHAR _drives[BUFFER_LEN]; diff --git a/reactos/subsys/system/explorer/shell/shellbrowser.cpp b/reactos/subsys/system/explorer/shell/shellbrowser.cpp index dbf08e0cc48..c4ffaa1c856 100644 --- a/reactos/subsys/system/explorer/shell/shellbrowser.cpp +++ b/reactos/subsys/system/explorer/shell/shellbrowser.cpp @@ -419,6 +419,13 @@ LRESULT ShellBrowserChild::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) } return TRUE;} + case PM_JUMP_TO: { + LPCTSTR url = (LPCTSTR)lparam; + + if (0) ///@todo + return TRUE; + break;} + default: return super::WndProc(nmsg, wparam, lparam); } diff --git a/reactos/subsys/system/explorer/shell/webchild.cpp b/reactos/subsys/system/explorer/shell/webchild.cpp index f421eed1a57..acb6a79800e 100644 --- a/reactos/subsys/system/explorer/shell/webchild.cpp +++ b/reactos/subsys/system/explorer/shell/webchild.cpp @@ -290,6 +290,13 @@ LRESULT WebChildWindow::WndProc(UINT message, WPARAM wparam, LPARAM lparam) return TRUE;} + case PM_JUMP_TO: { + LPCTSTR url = (LPCTSTR)lparam; + + if (0) ///@todo + return TRUE; + break;} + default: return super::WndProc(message, wparam, lparam); } diff --git a/reactos/subsys/system/explorer/utility/shellclasses.h b/reactos/subsys/system/explorer/utility/shellclasses.h index d62c4d984e7..cc57e388390 100644 --- a/reactos/subsys/system/explorer/utility/shellclasses.h +++ b/reactos/subsys/system/explorer/utility/shellclasses.h @@ -569,7 +569,7 @@ struct ShellPath : public SShellPtr CONTEXT("ShellPath::ShellPath(IShellFolder*, LPCWSTR)"); if (path) - CHECKERROR(folder->ParseDisplayName(0, 0, (LPOLESTR)path, NULL, &_p, 0)); + CHECKERROR(folder->ParseDisplayName(0, NULL, (LPOLESTR)path, NULL, &_p, NULL)); else _p = NULL; } @@ -579,7 +579,7 @@ struct ShellPath : public SShellPtr OBJ_CONTEXT("ShellPath::ShellPath(LPCWSTR)", path); if (path) - CHECKERROR(GetDesktopFolder()->ParseDisplayName(0, 0, (LPOLESTR)path, NULL, &_p, 0)); + CHECKERROR(GetDesktopFolder()->ParseDisplayName(0, NULL, (LPOLESTR)path, NULL, &_p, NULL)); else _p = NULL; } @@ -592,7 +592,7 @@ struct ShellPath : public SShellPtr if (path) { MultiByteToWideChar(CP_ACP, 0, path, -1, b, MAX_PATH); - CHECKERROR(folder->ParseDisplayName(0, 0, b, NULL, &_p, 0)); + CHECKERROR(folder->ParseDisplayName(0, NULL, b, NULL, &_p, NULL)); } else _p = NULL; } @@ -605,7 +605,7 @@ struct ShellPath : public SShellPtr if (path) { MultiByteToWideChar(CP_ACP, 0, path, -1, b, MAX_PATH); - CHECKERROR(GetDesktopFolder()->ParseDisplayName(0, 0, b, NULL, &_p, 0)); + CHECKERROR(GetDesktopFolder()->ParseDisplayName(0, NULL, b, NULL, &_p, NULL)); } else _p = NULL; }