From 236d7d694b91619f0732d1c56b92bd42f1983be9 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 14 Jul 2010 00:13:26 +0200 Subject: [PATCH] shdocvw: Support links opening in new window by opening in winebrowser. This is not guaranteed to work (app doesn't have control over it, different cookie manager...). --- dlls/shdocvw/navigate.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/dlls/shdocvw/navigate.c b/dlls/shdocvw/navigate.c index 6f05cf2da28..712fce59eff 100644 --- a/dlls/shdocvw/navigate.c +++ b/dlls/shdocvw/navigate.c @@ -888,6 +888,32 @@ HRESULT go_home(DocHost *This) return navigate_url(This, wszPageName, NULL, NULL, NULL, NULL); } +static HRESULT open_in_new_window(IMoniker *mon) +{ + SHELLEXECUTEINFOW exec_info; + LPWSTR url; + HRESULT hres; + + static const WCHAR wszHtmlFile[] = {'.','h','t','m','l',0}; + + hres = IMoniker_GetDisplayName(mon, NULL, NULL, &url); + if(FAILED(hres)) + return hres; + + memset(&exec_info, 0, sizeof(exec_info)); + exec_info.cbSize = sizeof(exec_info); + exec_info.fMask = SEE_MASK_CLASSNAME; + exec_info.lpFile = url; + exec_info.nShow = SW_SHOW; + exec_info.lpClass = wszHtmlFile; + + ShellExecuteExW(&exec_info); + + CoTaskMemFree(url); + + return S_OK; +} + #define HLINKFRAME_THIS(iface) DEFINE_THIS(WebBrowser, HlinkFrame, iface) static HRESULT WINAPI HlinkFrame_QueryInterface(IHlinkFrame *iface, REFIID riid, void **ppv) @@ -949,7 +975,7 @@ static HRESULT WINAPI HlinkFrame_Navigate(IHlinkFrame *iface, DWORD grfHLNF, LPB if(grfHLNF & HLNF_OPENINNEWWINDOW) { FIXME("Not supported HLNF_OPENINNEWWINDOW\n"); - return E_NOTIMPL; + return open_in_new_window(mon); } return navigate_hlink(&This->doc_host, mon, pbc, pibsc); -- 2.11.4.GIT