shell32: Simplify cut/copy operations.
This commit is contained in:
parent
ba999f05e1
commit
b49c9ac923
|
@ -257,29 +257,17 @@ static void DoDelete(ContextMenu *This)
|
||||||
*
|
*
|
||||||
* copies the currently selected items into the clipboard
|
* copies the currently selected items into the clipboard
|
||||||
*/
|
*/
|
||||||
static BOOL DoCopyOrCut(ContextMenu *This, HWND hwnd, BOOL cut)
|
static void DoCopyOrCut(ContextMenu *This, HWND hwnd, BOOL cut)
|
||||||
{
|
{
|
||||||
IDataObject *dataobject;
|
IDataObject *dataobject;
|
||||||
IShellBrowser *browser;
|
|
||||||
IShellView *view;
|
|
||||||
|
|
||||||
TRACE("(%p)->(wnd=%p, cut=%d)\n", This, hwnd, cut);
|
TRACE("(%p)->(wnd=%p, cut=%d)\n", This, hwnd, cut);
|
||||||
|
|
||||||
/* get the active IShellView */
|
if (SUCCEEDED(IShellFolder_GetUIObjectOf(This->parent, hwnd, This->cidl, (LPCITEMIDLIST*)This->apidl, &IID_IDataObject, 0, (void**)&dataobject)))
|
||||||
if ((browser = (IShellBrowser*)SendMessageA(hwnd, CWM_GETISHELLBROWSER, 0, 0)))
|
|
||||||
{
|
{
|
||||||
if (SUCCEEDED(IShellBrowser_QueryActiveShellView(browser, &view)))
|
OleSetClipboard(dataobject);
|
||||||
{
|
IDataObject_Release(dataobject);
|
||||||
if (SUCCEEDED(IShellView_GetItemObject(view, SVGIO_SELECTION, &IID_IDataObject, (void**)&dataobject)))
|
|
||||||
{
|
|
||||||
OleSetClipboard(dataobject);
|
|
||||||
IDataObject_Release(dataobject);
|
|
||||||
}
|
|
||||||
IShellView_Release(view);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
|
Loading…
Reference in New Issue