Commit 0a32123d authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shell32: Add IShellFolderView::RemoveObject for IShellView.

parent 1f6c759e
...@@ -585,19 +585,6 @@ static BOOLEAN LV_AddItem(IShellViewImpl * This, LPCITEMIDLIST pidl) ...@@ -585,19 +585,6 @@ static BOOLEAN LV_AddItem(IShellViewImpl * This, LPCITEMIDLIST pidl)
} }
/********************************************************** /**********************************************************
* LV_DeleteItem()
*/
static BOOLEAN LV_DeleteItem(IShellViewImpl * This, LPCITEMIDLIST pidl)
{
int nIndex;
TRACE("(%p)(pidl=%p)\n", This, pidl);
nIndex = LV_FindItemByPidl(This, ILFindLastID(pidl));
return (-1==SendMessageW(This->hWndList, LVM_DELETEITEM, nIndex, 0))? FALSE: TRUE;
}
/**********************************************************
* LV_RenameItem() * LV_RenameItem()
*/ */
static BOOLEAN LV_RenameItem(IShellViewImpl * This, LPCITEMIDLIST pidlOld, LPCITEMIDLIST pidlNew ) static BOOLEAN LV_RenameItem(IShellViewImpl * This, LPCITEMIDLIST pidlOld, LPCITEMIDLIST pidlNew )
...@@ -1608,28 +1595,33 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn ...@@ -1608,28 +1595,33 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn
* ShellView_OnChange() * ShellView_OnChange()
*/ */
static LRESULT ShellView_OnChange(IShellViewImpl * This, const LPCITEMIDLIST * Pidls, LONG wEventId) static LRESULT ShellView_OnChange(IShellViewImpl * This, const LPCITEMIDLIST *pidls, LONG event)
{ {
BOOL ret = TRUE;
TRACE("(%p)(%p,%p,0x%08x)\n", This, Pidls[0], Pidls[1], wEventId); TRACE("(%p)->(%p, %p, 0x%08x)\n", This, pidls[0], pidls[1], event);
switch(wEventId)
{ switch (event)
case SHCNE_MKDIR: {
case SHCNE_CREATE: case SHCNE_MKDIR:
LV_AddItem(This, Pidls[0]); case SHCNE_CREATE:
break; LV_AddItem(This, pidls[0]);
case SHCNE_RMDIR: break;
case SHCNE_DELETE: case SHCNE_RMDIR:
LV_DeleteItem(This, Pidls[0]); case SHCNE_DELETE:
break; {
case SHCNE_RENAMEFOLDER: INT i = LV_FindItemByPidl(This, ILFindLastID(pidls[0]));
case SHCNE_RENAMEITEM: ret = SendMessageW(This->hWndList, LVM_DELETEITEM, i, 0);
LV_RenameItem(This, Pidls[0], Pidls[1]); break;
break; }
case SHCNE_UPDATEITEM: case SHCNE_RENAMEFOLDER:
case SHCNE_RENAMEITEM:
LV_RenameItem(This, pidls[0], pidls[1]);
break;
case SHCNE_UPDATEITEM:
break; break;
} }
return TRUE; return ret;
} }
/********************************************************** /**********************************************************
* ShellView_WndProc * ShellView_WndProc
...@@ -2989,8 +2981,21 @@ static HRESULT WINAPI IShellFolderView_fnRemoveObject( ...@@ -2989,8 +2981,21 @@ static HRESULT WINAPI IShellFolderView_fnRemoveObject(
UINT *item) UINT *item)
{ {
IShellViewImpl *This = impl_from_IShellFolderView(iface); IShellViewImpl *This = impl_from_IShellFolderView(iface);
FIXME("(%p)->(%p %p) stub\n", This, pidl, item);
return E_NOTIMPL; TRACE("(%p)->(%p %p)\n", This, pidl, item);
if (pidl)
{
*item = LV_FindItemByPidl(This, ILFindLastID(pidl));
SendMessageW(This->hWndList, LVM_DELETEITEM, *item, 0);
}
else
{
*item = 0;
SendMessageW(This->hWndList, LVM_DELETEALLITEMS, 0, 0);
}
return S_OK;
} }
static HRESULT WINAPI IShellFolderView_fnGetObjectCount( static HRESULT WINAPI IShellFolderView_fnGetObjectCount(
......
...@@ -581,6 +581,12 @@ static void test_IShellFolderView(void) ...@@ -581,6 +581,12 @@ static void test_IShellFolderView(void)
ok(hr == S_OK, "got (0x%08x)\n", hr); ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(i == 0xdeadbeef, "got %d\n", i); ok(i == 0xdeadbeef, "got %d\n", i);
/* ::RemoveObject */
i = 0xdeadbeef;
hr = IShellFolderView_RemoveObject(folderview, NULL, &i);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(i == 0, "got %d\n", i);
IShellFolderView_Release(folderview); IShellFolderView_Release(folderview);
IShellView_Release(view); IShellView_Release(view);
......
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