Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6923ec27
Commit
6923ec27
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 HitTest.
parent
193fe3c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
115 additions
and
2 deletions
+115
-2
nstc.c
dlls/explorerframe/nstc.c
+31
-2
nstc.c
dlls/explorerframe/tests/nstc.c
+84
-0
No files found.
dlls/explorerframe/nstc.c
View file @
6923ec27
...
...
@@ -422,6 +422,18 @@ static void collapse_all(NSTC2Impl *This, HTREEITEM node)
if
(
next
)
collapse_all
(
This
,
next
);
}
static
HTREEITEM
treeitem_from_point
(
NSTC2Impl
*
This
,
POINT
*
pt
,
UINT
*
hitflag
)
{
TVHITTESTINFO
tviht
;
tviht
.
pt
.
x
=
pt
->
x
;
tviht
.
pt
.
y
=
pt
->
y
;
tviht
.
hItem
=
NULL
;
SendMessageW
(
This
->
hwnd_tv
,
TVM_HITTEST
,
0
,
(
LPARAM
)
&
tviht
);
if
(
hitflag
)
*
hitflag
=
tviht
.
flags
;
return
tviht
.
hItem
;
}
/*************************************************************************
* NamespaceTree window functions
*/
...
...
@@ -1309,8 +1321,25 @@ static HRESULT WINAPI NSTC2_fnHitTest(INameSpaceTreeControl2* iface,
IShellItem
**
ppsiOut
)
{
NSTC2Impl
*
This
=
(
NSTC2Impl
*
)
iface
;
FIXME
(
"stub, %p (%p, %p)
\n
"
,
This
,
ppsiOut
,
ppt
);
return
E_NOTIMPL
;
HTREEITEM
hitem
;
TRACE
(
"%p (%p, %p)
\n
"
,
This
,
ppsiOut
,
ppt
);
if
(
!
ppt
||
!
ppsiOut
)
return
E_POINTER
;
*
ppsiOut
=
NULL
;
hitem
=
treeitem_from_point
(
This
,
ppt
,
NULL
);
if
(
hitem
)
*
ppsiOut
=
shellitem_from_treeitem
(
This
,
hitem
);
if
(
*
ppsiOut
)
{
IShellItem_AddRef
(
*
ppsiOut
);
return
S_OK
;
}
return
S_FALSE
;
}
static
HRESULT
WINAPI
NSTC2_fnGetItemRect
(
INameSpaceTreeControl2
*
iface
,
...
...
dlls/explorerframe/tests/nstc.c
View file @
6923ec27
...
...
@@ -734,6 +734,7 @@ static void test_basics(void)
HWND
hwnd_tv
;
RECT
rc
;
IShellItem
*
roots
[
10
];
POINT
pt
;
WCHAR
curdirW
[
MAX_PATH
];
WCHAR
buf
[
MAX_PATH
];
static
const
WCHAR
testdirW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'd'
,
'i'
,
'r'
,
0
};
...
...
@@ -1555,6 +1556,89 @@ static void test_basics(void)
hr
=
INameSpaceTreeControl_RemoveAllRoots
(
pnstc
);
ok
(
hr
==
S_OK
,
"Got (0x%08x)
\n
"
,
hr
);
/* HitTest */
hr
=
INameSpaceTreeControl_HitTest
(
pnstc
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Got 0x%08x
\n
"
,
hr
);
hr
=
INameSpaceTreeControl_HitTest
(
pnstc
,
&
pt
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Got 0x%08x
\n
"
,
hr
);
hr
=
INameSpaceTreeControl_HitTest
(
pnstc
,
NULL
,
&
psi
);
ok
(
hr
==
E_POINTER
,
"Got 0x%08x
\n
"
,
hr
);
psi
=
(
void
*
)
0xdeadbeef
;
hr
=
INameSpaceTreeControl_HitTest
(
pnstc
,
&
pt
,
&
psi
);
ok
(
hr
==
S_FALSE
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
psi
==
NULL
,
"Got psi %p
\n
"
,
psi
);
hr
=
INameSpaceTreeControl_AppendRoot
(
pnstc
,
psitestdir
,
SHCONTF_FOLDERS
|
SHCONTF_NONFOLDERS
,
NSTCRS_EXPANDED
,
NULL
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
process_msgs
();
pt
.
x
=
pt
.
y
=
0
;
hr
=
INameSpaceTreeControl_HitTest
(
pnstc
,
&
pt
,
&
psi
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
int
cmp
;
hr
=
IShellItem_Compare
(
psi
,
psitestdir
,
SICHINT_DISPLAY
,
&
cmp
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
!
cmp
,
"Got cmp %d
\n
"
,
cmp
);
IShellItem_Release
(
psi
);
}
pt
.
y
+=
height
-
1
;
hr
=
INameSpaceTreeControl_HitTest
(
pnstc
,
&
pt
,
&
psi
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
int
cmp
;
hr
=
IShellItem_Compare
(
psi
,
psitestdir
,
SICHINT_DISPLAY
,
&
cmp
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
!
cmp
,
"Got cmp %d
\n
"
,
cmp
);
IShellItem_Release
(
psi
);
}
pt
.
y
+=
1
;
hr
=
INameSpaceTreeControl_HitTest
(
pnstc
,
&
pt
,
&
psi
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
int
cmp
;
todo_wine
{
hr
=
IShellItem_Compare
(
psi
,
psitestdir
,
SICHINT_DISPLAY
,
&
cmp
);
ok
(
hr
==
S_FALSE
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
cmp
,
"no cmp value.
\n
"
);
hr
=
IShellItem_Compare
(
psi
,
psitestdir2
,
SICHINT_DISPLAY
,
&
cmp
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
!
cmp
,
"Got cmp %d
\n
"
,
cmp
);
}
IShellItem_Release
(
psi
);
}
hr
=
INameSpaceTreeControl_GetItemRect
(
pnstc
,
psitestdir2
,
&
rc
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
MapWindowPoints
(
NULL
,
hwnd
,
(
POINT
*
)
&
rc
,
2
);
pt
.
x
=
rc
.
left
;
pt
.
y
=
rc
.
top
;
hr
=
INameSpaceTreeControl_HitTest
(
pnstc
,
&
pt
,
&
psi
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
int
cmp
;
hr
=
IShellItem_Compare
(
psi
,
psitestdir2
,
SICHINT_DISPLAY
,
&
cmp
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
!
cmp
,
"Got cmp %d
\n
"
,
cmp
);
IShellItem_Release
(
psi
);
}
}
hr
=
INameSpaceTreeControl_RemoveAllRoots
(
pnstc
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
IShellItem_Release
(
psidesktop
);
IShellItem_Release
(
psidesktop2
);
IShellItem_Release
(
psitestdir
);
...
...
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