Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e5ab57f2
Commit
e5ab57f2
authored
Aug 19, 2010
by
David Hedberg
Committed by
Alexandre Julliard
Aug 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explorerframe: Implement EnsureItemVisible.
parent
6923ec27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
2 deletions
+76
-2
nstc.c
dlls/explorerframe/nstc.c
+12
-2
nstc.c
dlls/explorerframe/tests/nstc.c
+64
-0
No files found.
dlls/explorerframe/nstc.c
View file @
e5ab57f2
...
...
@@ -1259,8 +1259,18 @@ static HRESULT WINAPI NSTC2_fnEnsureItemVisible(INameSpaceTreeControl2* iface,
IShellItem
*
psi
)
{
NSTC2Impl
*
This
=
(
NSTC2Impl
*
)
iface
;
FIXME
(
"stub, %p (%p)
\n
"
,
This
,
psi
);
return
E_NOTIMPL
;
HTREEITEM
hitem
;
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
,
...
...
dlls/explorerframe/tests/nstc.c
View file @
e5ab57f2
...
...
@@ -35,6 +35,7 @@ static HWND hwnd;
static
HRESULT
(
WINAPI
*
pSHCreateShellItem
)(
LPCITEMIDLIST
,
IShellFolder
*
,
LPCITEMIDLIST
,
IShellItem
**
);
static
HRESULT
(
WINAPI
*
pSHGetIDListFromObject
)(
IUnknown
*
,
PIDLIST_ABSOLUTE
*
);
static
HRESULT
(
WINAPI
*
pSHCreateItemFromParsingName
)(
PCWSTR
,
IBindCtx
*
,
REFIID
,
void
**
);
static
HRESULT
(
WINAPI
*
pSHGetSpecialFolderLocation
)(
HWND
,
int
,
LPITEMIDLIST
*
);
#define NUM_MSG_SEQUENCES 1
#define TREEVIEW_SEQ_INDEX 0
...
...
@@ -53,6 +54,7 @@ static void init_function_pointers(void)
pSHCreateShellItem
=
(
void
*
)
GetProcAddress
(
hmod
,
"SHCreateShellItem"
);
pSHGetIDListFromObject
=
(
void
*
)
GetProcAddress
(
hmod
,
"SHGetIDListFromObject"
);
pSHCreateItemFromParsingName
=
(
void
*
)
GetProcAddress
(
hmod
,
"SHCreateItemFromParsingName"
);
pSHGetSpecialFolderLocation
=
(
void
*
)
GetProcAddress
(
hmod
,
"SHGetSpecialFolderLocation"
);
}
/*******************************************************
...
...
@@ -1672,6 +1674,7 @@ static void test_events(void)
IShellItem
*
psidesktop
;
IOleWindow
*
pow
;
LPITEMIDLIST
pidl_desktop
;
LPITEMIDLIST
pidl_drives
;
NSTCITEMSTATE
itemstate
;
IShellItem
*
psi
;
DWORD
cookie1
,
cookie2
;
...
...
@@ -2195,6 +2198,67 @@ static void test_events(void)
ok_event_count
(
pnstceimpl
,
OnItemDeleted
,
1
);
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
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment