Commit f118c64d authored by David Hedberg's avatar David Hedberg Committed by Alexandre Julliard

shell32: Implement CommDlgBrowser::OnDefaultCommand in the ExplorerBrowser control.

parent 59965f9c
......@@ -1082,8 +1082,46 @@ static HRESULT WINAPI ICommDlgBrowser3_fnOnDefaultCommand(ICommDlgBrowser3 *ifac
IShellView *shv)
{
ExplorerBrowserImpl *This = impl_from_ICommDlgBrowser3(iface);
FIXME("stub, %p (%p)\n", This, shv);
return E_NOTIMPL;
IDataObject *pdo;
HRESULT hr;
HRESULT ret = S_FALSE;
TRACE("%p (%p)\n", This, shv);
hr = IShellView_GetItemObject(shv, SVGIO_SELECTION, &IID_IDataObject, (void**)&pdo);
if(SUCCEEDED(hr))
{
FORMATETC fmt;
STGMEDIUM medium;
fmt.cfFormat = RegisterClipboardFormatW(CFSTR_SHELLIDLISTW);
fmt.ptd = NULL;
fmt.dwAspect = DVASPECT_CONTENT;
fmt.lindex = -1;
fmt.tymed = TYMED_HGLOBAL;
hr = IDataObject_GetData(pdo, &fmt ,&medium);
IDataObject_Release(pdo);
if(SUCCEEDED(hr))
{
LPIDA pida = GlobalLock(medium.u.hGlobal);
LPCITEMIDLIST pidl_child = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[1]);
/* Handle folders by browsing to them. */
if(_ILIsFolder(pidl_child) || _ILIsDrive(pidl_child) || _ILIsSpecialFolder(pidl_child))
{
IExplorerBrowser_BrowseToIDList((IExplorerBrowser*)This, pidl_child, SBSP_RELATIVE);
ret = S_OK;
}
GlobalUnlock(medium.u.hGlobal);
GlobalFree(medium.u.hGlobal);
}
else
ERR("Failed to get data from IDataObject.\n");
} else
ERR("Failed to get IDataObject.\n");
return ret;
}
static HRESULT WINAPI ICommDlgBrowser3_fnOnStateChange(ICommDlgBrowser3 *iface,
IShellView *shv, ULONG uChange)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment