shdocvw: Implement UniformResourceLocatorW_InvokeCommand and UniformResourceLocatorA_InvokeCommand for the default verb.
This commit is contained in:
parent
ce0e1f07dc
commit
44f929fc25
|
@ -32,6 +32,8 @@
|
||||||
#include "objidl.h"
|
#include "objidl.h"
|
||||||
#include "shobjidl.h"
|
#include "shobjidl.h"
|
||||||
#include "intshcut.h"
|
#include "intshcut.h"
|
||||||
|
#include "shellapi.h"
|
||||||
|
#include "winreg.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
||||||
|
|
||||||
|
@ -237,8 +239,47 @@ static HRESULT WINAPI UniformResourceLocatorW_GetUrl(IUniformResourceLocatorW *u
|
||||||
|
|
||||||
static HRESULT WINAPI UniformResourceLocatorW_InvokeCommand(IUniformResourceLocatorW *url, PURLINVOKECOMMANDINFOW pCommandInfo)
|
static HRESULT WINAPI UniformResourceLocatorW_InvokeCommand(IUniformResourceLocatorW *url, PURLINVOKECOMMANDINFOW pCommandInfo)
|
||||||
{
|
{
|
||||||
FIXME("(%p, %p): stub\n", url, pCommandInfo);
|
InternetShortcut *This = impl_from_IUniformResourceLocatorW(url);
|
||||||
|
WCHAR app[64];
|
||||||
|
HKEY hkey;
|
||||||
|
static const WCHAR wszURLProtocol[] = {'U','R','L',' ','P','r','o','t','o','c','o','l',0};
|
||||||
|
SHELLEXECUTEINFOW sei;
|
||||||
|
DWORD res, type;
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
|
TRACE("%p %p\n", This, pCommandInfo );
|
||||||
|
|
||||||
|
if (pCommandInfo->dwcbSize < sizeof (URLINVOKECOMMANDINFOW))
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
if (pCommandInfo->dwFlags != IURL_INVOKECOMMAND_FL_USE_DEFAULT_VERB)
|
||||||
|
{
|
||||||
|
FIXME("(%p, %p): non-default verbs not implemented\n", url, pCommandInfo);
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
hres = CoInternetParseUrl(This->url, PARSE_SCHEMA, 0, app, sizeof(app)/sizeof(WCHAR), NULL, 0);
|
||||||
|
if(FAILED(hres))
|
||||||
|
return E_FAIL;
|
||||||
|
|
||||||
|
res = RegOpenKeyW(HKEY_CLASSES_ROOT, app, &hkey);
|
||||||
|
if(res != ERROR_SUCCESS)
|
||||||
|
return E_FAIL;
|
||||||
|
|
||||||
|
res = RegQueryValueExW(hkey, wszURLProtocol, NULL, &type, NULL, NULL);
|
||||||
|
RegCloseKey(hkey);
|
||||||
|
if(res != ERROR_SUCCESS || type != REG_SZ)
|
||||||
|
return E_FAIL;
|
||||||
|
|
||||||
|
memset(&sei, 0, sizeof(sei));
|
||||||
|
sei.cbSize = sizeof(sei);
|
||||||
|
sei.lpFile = This->url;
|
||||||
|
sei.nShow = SW_SHOW;
|
||||||
|
|
||||||
|
if( ShellExecuteExW(&sei) )
|
||||||
|
return S_OK;
|
||||||
|
else
|
||||||
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI UniformResourceLocatorA_QueryInterface(IUniformResourceLocatorA *url, REFIID riid, PVOID *ppvObject)
|
static HRESULT WINAPI UniformResourceLocatorA_QueryInterface(IUniformResourceLocatorA *url, REFIID riid, PVOID *ppvObject)
|
||||||
|
@ -299,8 +340,26 @@ static HRESULT WINAPI UniformResourceLocatorA_GetUrl(IUniformResourceLocatorA *u
|
||||||
|
|
||||||
static HRESULT WINAPI UniformResourceLocatorA_InvokeCommand(IUniformResourceLocatorA *url, PURLINVOKECOMMANDINFOA pCommandInfo)
|
static HRESULT WINAPI UniformResourceLocatorA_InvokeCommand(IUniformResourceLocatorA *url, PURLINVOKECOMMANDINFOA pCommandInfo)
|
||||||
{
|
{
|
||||||
FIXME("(%p, %p): stub\n", url, pCommandInfo);
|
URLINVOKECOMMANDINFOW wideCommandInfo;
|
||||||
return E_NOTIMPL;
|
int len;
|
||||||
|
WCHAR *wideVerb;
|
||||||
|
HRESULT res;
|
||||||
|
InternetShortcut *This = impl_from_IUniformResourceLocatorA(url);
|
||||||
|
|
||||||
|
wideCommandInfo.dwcbSize = sizeof wideCommandInfo;
|
||||||
|
wideCommandInfo.dwFlags = pCommandInfo->dwFlags;
|
||||||
|
wideCommandInfo.hwndParent = pCommandInfo->hwndParent;
|
||||||
|
|
||||||
|
len = MultiByteToWideChar(CP_ACP, 0, pCommandInfo->pcszVerb, -1, NULL, 0);
|
||||||
|
wideVerb = heap_alloc(len * sizeof(WCHAR));
|
||||||
|
MultiByteToWideChar(CP_ACP, 0, pCommandInfo->pcszVerb, -1, wideVerb, len);
|
||||||
|
|
||||||
|
wideCommandInfo.pcszVerb = wideVerb;
|
||||||
|
|
||||||
|
res = UniformResourceLocatorW_InvokeCommand(&This->uniformResourceLocatorW, &wideCommandInfo);
|
||||||
|
heap_free(wideVerb);
|
||||||
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI PersistFile_QueryInterface(IPersistFile *pFile, REFIID riid, PVOID *ppvObject)
|
static HRESULT WINAPI PersistFile_QueryInterface(IPersistFile *pFile, REFIID riid, PVOID *ppvObject)
|
||||||
|
|
Loading…
Reference in New Issue