explorerframe: Implement EnsureItemVisible.
This commit is contained in:
parent
6923ec2708
commit
e5ab57f2c6
|
@ -1259,8 +1259,18 @@ static HRESULT WINAPI NSTC2_fnEnsureItemVisible(INameSpaceTreeControl2* iface,
|
||||||
IShellItem *psi)
|
IShellItem *psi)
|
||||||
{
|
{
|
||||||
NSTC2Impl *This = (NSTC2Impl*)iface;
|
NSTC2Impl *This = (NSTC2Impl*)iface;
|
||||||
FIXME("stub, %p (%p)\n", This, psi);
|
HTREEITEM hitem;
|
||||||
return E_NOTIMPL;
|
|
||||||
|
TRACE("%p (%p)\n", This, psi);
|
||||||
|
|
||||||
|
hitem = treeitem_from_shellitem(This, psi);
|
||||||
|
if(hitem)
|
||||||
|
{
|
||||||
|
SendMessageW(This->hwnd_tv, TVM_ENSUREVISIBLE, 0, (WPARAM)hitem);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
return E_INVALIDARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI NSTC2_fnSetTheme(INameSpaceTreeControl2* iface,
|
static HRESULT WINAPI NSTC2_fnSetTheme(INameSpaceTreeControl2* iface,
|
||||||
|
|
|
@ -35,6 +35,7 @@ static HWND hwnd;
|
||||||
static HRESULT (WINAPI *pSHCreateShellItem)(LPCITEMIDLIST,IShellFolder*,LPCITEMIDLIST,IShellItem**);
|
static HRESULT (WINAPI *pSHCreateShellItem)(LPCITEMIDLIST,IShellFolder*,LPCITEMIDLIST,IShellItem**);
|
||||||
static HRESULT (WINAPI *pSHGetIDListFromObject)(IUnknown*, PIDLIST_ABSOLUTE*);
|
static HRESULT (WINAPI *pSHGetIDListFromObject)(IUnknown*, PIDLIST_ABSOLUTE*);
|
||||||
static HRESULT (WINAPI *pSHCreateItemFromParsingName)(PCWSTR,IBindCtx*,REFIID,void**);
|
static HRESULT (WINAPI *pSHCreateItemFromParsingName)(PCWSTR,IBindCtx*,REFIID,void**);
|
||||||
|
static HRESULT (WINAPI *pSHGetSpecialFolderLocation)(HWND, int, LPITEMIDLIST *);
|
||||||
|
|
||||||
#define NUM_MSG_SEQUENCES 1
|
#define NUM_MSG_SEQUENCES 1
|
||||||
#define TREEVIEW_SEQ_INDEX 0
|
#define TREEVIEW_SEQ_INDEX 0
|
||||||
|
@ -53,6 +54,7 @@ static void init_function_pointers(void)
|
||||||
pSHCreateShellItem = (void*)GetProcAddress(hmod, "SHCreateShellItem");
|
pSHCreateShellItem = (void*)GetProcAddress(hmod, "SHCreateShellItem");
|
||||||
pSHGetIDListFromObject = (void*)GetProcAddress(hmod, "SHGetIDListFromObject");
|
pSHGetIDListFromObject = (void*)GetProcAddress(hmod, "SHGetIDListFromObject");
|
||||||
pSHCreateItemFromParsingName = (void*)GetProcAddress(hmod, "SHCreateItemFromParsingName");
|
pSHCreateItemFromParsingName = (void*)GetProcAddress(hmod, "SHCreateItemFromParsingName");
|
||||||
|
pSHGetSpecialFolderLocation = (void*)GetProcAddress(hmod, "SHGetSpecialFolderLocation");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************
|
/*******************************************************
|
||||||
|
@ -1672,6 +1674,7 @@ static void test_events(void)
|
||||||
IShellItem *psidesktop;
|
IShellItem *psidesktop;
|
||||||
IOleWindow *pow;
|
IOleWindow *pow;
|
||||||
LPITEMIDLIST pidl_desktop;
|
LPITEMIDLIST pidl_desktop;
|
||||||
|
LPITEMIDLIST pidl_drives;
|
||||||
NSTCITEMSTATE itemstate;
|
NSTCITEMSTATE itemstate;
|
||||||
IShellItem *psi;
|
IShellItem *psi;
|
||||||
DWORD cookie1, cookie2;
|
DWORD cookie1, cookie2;
|
||||||
|
@ -2195,6 +2198,67 @@ static void test_events(void)
|
||||||
ok_event_count(pnstceimpl, OnItemDeleted, 1);
|
ok_event_count(pnstceimpl, OnItemDeleted, 1);
|
||||||
ok_no_events(pnstceimpl);
|
ok_no_events(pnstceimpl);
|
||||||
|
|
||||||
|
/* EnsureItemVisible */
|
||||||
|
if(0)
|
||||||
|
{
|
||||||
|
/* Crashes on Windows 7 */
|
||||||
|
hr = INameSpaceTreeControl_EnsureItemVisible(pnstc, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
hr = INameSpaceTreeControl_EnsureItemVisible(pnstc, psidesktop);
|
||||||
|
ok(hr == E_INVALIDARG || hr == E_FAIL, "Got (0x%08x)\n", hr);
|
||||||
|
ok_no_events(pnstceimpl);
|
||||||
|
|
||||||
|
hr = pSHGetSpecialFolderLocation(NULL, CSIDL_DRIVES, &pidl_drives);
|
||||||
|
ok(hr == S_OK, "Got (0x%08x)\n", hr);
|
||||||
|
if(SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
hr = pSHCreateShellItem(NULL, NULL, pidl_drives, &psi);
|
||||||
|
ok(hr == S_OK, "Got (0x%08x)\n", hr);
|
||||||
|
if(SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
hr = INameSpaceTreeControl_AppendRoot(pnstc, psi, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, 0, NULL);
|
||||||
|
ok(hr == S_OK, "Got (0x%08x)\n", hr);
|
||||||
|
process_msgs();
|
||||||
|
ok_event_count_broken(pnstceimpl, OnItemAdded, 1, 0 /* Vista */);
|
||||||
|
ok_no_events(pnstceimpl);
|
||||||
|
|
||||||
|
hr = INameSpaceTreeControl_EnsureItemVisible(pnstc, psidesktop);
|
||||||
|
ok(hr == E_INVALIDARG, "Got (0x%08x)\n", hr);
|
||||||
|
ok_no_events(pnstceimpl);
|
||||||
|
|
||||||
|
hr = INameSpaceTreeControl_EnsureItemVisible(pnstc, psi);
|
||||||
|
ok(hr == S_OK, "Got (0x%08x)\n", hr);
|
||||||
|
ok_no_events(pnstceimpl);
|
||||||
|
|
||||||
|
hr = INameSpaceTreeControl_AppendRoot(pnstc, psidesktop, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, 0, NULL);
|
||||||
|
ok(hr == S_OK, "Got (0x%08x)\n", hr);
|
||||||
|
process_msgs();
|
||||||
|
ok_event_count_broken(pnstceimpl, OnItemAdded, 1, 0 /* Vista */);
|
||||||
|
ok_no_events(pnstceimpl);
|
||||||
|
|
||||||
|
hr = INameSpaceTreeControl_EnsureItemVisible(pnstc, psidesktop);
|
||||||
|
ok(hr == S_OK, "Got (0x%08x)\n", hr);
|
||||||
|
ok_no_events(pnstceimpl);
|
||||||
|
|
||||||
|
hr = INameSpaceTreeControl_EnsureItemVisible(pnstc, psi);
|
||||||
|
ok(hr == S_OK, "Got (0x%08x)\n", hr);
|
||||||
|
ok_no_events(pnstceimpl);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
skip("Failed to create shellitem.\n");
|
||||||
|
|
||||||
|
ILFree(pidl_drives);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
skip("Failed to get pidl for CSIDL_DRIVES.\n");
|
||||||
|
|
||||||
|
hr = INameSpaceTreeControl_RemoveAllRoots(pnstc);
|
||||||
|
ok(hr == S_OK, "Got (0x%08x)\n", hr);
|
||||||
|
ok_event_count(pnstceimpl, OnItemDeleted, 2);
|
||||||
|
ok_no_events(pnstceimpl);
|
||||||
|
|
||||||
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleWindow, (void**)&pow);
|
hr = INameSpaceTreeControl_QueryInterface(pnstc, &IID_IOleWindow, (void**)&pow);
|
||||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||||
if(SUCCEEDED(hr))
|
if(SUCCEEDED(hr))
|
||||||
|
|
Loading…
Reference in New Issue