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
193fe3c3
Commit
193fe3c3
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 GetItemRect.
parent
9816ec85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
3 deletions
+78
-3
nstc.c
dlls/explorerframe/nstc.c
+18
-2
nstc.c
dlls/explorerframe/tests/nstc.c
+60
-1
No files found.
dlls/explorerframe/nstc.c
View file @
193fe3c3
...
...
@@ -1318,8 +1318,24 @@ static HRESULT WINAPI NSTC2_fnGetItemRect(INameSpaceTreeControl2* iface,
RECT
*
prect
)
{
NSTC2Impl
*
This
=
(
NSTC2Impl
*
)
iface
;
FIXME
(
"stub, %p (%p, %p)
\n
"
,
This
,
psi
,
prect
);
return
E_NOTIMPL
;
HTREEITEM
hitem
;
TRACE
(
"%p (%p, %p)
\n
"
,
This
,
psi
,
prect
);
if
(
!
psi
||
!
prect
)
return
E_POINTER
;
hitem
=
treeitem_from_shellitem
(
This
,
psi
);
if
(
hitem
)
{
*
(
HTREEITEM
*
)
prect
=
hitem
;
if
(
SendMessageW
(
This
->
hwnd_tv
,
TVM_GETITEMRECT
,
FALSE
,
(
LPARAM
)
prect
))
{
MapWindowPoints
(
This
->
hwnd_tv
,
HWND_DESKTOP
,
(
POINT
*
)
prect
,
2
);
return
S_OK
;
}
}
return
E_INVALIDARG
;
}
static
HRESULT
WINAPI
NSTC2_fnCollapseAll
(
INameSpaceTreeControl2
*
iface
)
...
...
dlls/explorerframe/tests/nstc.c
View file @
193fe3c3
...
...
@@ -730,7 +730,8 @@ static void test_basics(void)
LPITEMIDLIST
pidl_desktop
;
NSTCITEMSTATE
istate
;
HRESULT
hr
;
UINT
i
,
res
;
UINT
i
,
res
,
height
;
HWND
hwnd_tv
;
RECT
rc
;
IShellItem
*
roots
[
10
];
WCHAR
curdirW
[
MAX_PATH
];
...
...
@@ -1496,6 +1497,64 @@ static void test_basics(void)
hr
=
INameSpaceTreeControl_RemoveAllRoots
(
pnstc
);
ok
(
hr
==
S_OK
,
"Got (0x%08x)
\n
"
,
hr
);
/* GetItemRect */
rc
.
top
=
rc
.
left
=
rc
.
bottom
=
rc
.
right
=
0
;
if
(
0
)
{
/* Crashes under win 7 */
hr
=
INameSpaceTreeControl_GetItemRect
(
pnstc
,
NULL
,
NULL
);
hr
=
INameSpaceTreeControl_GetItemRect
(
pnstc
,
psitestdir
,
NULL
);
hr
=
INameSpaceTreeControl_GetItemRect
(
pnstc
,
NULL
,
&
rc
);
}
hr
=
INameSpaceTreeControl_GetItemRect
(
pnstc
,
psitestdir
,
&
rc
);
ok
(
hr
==
E_INVALIDARG
,
"Got 0x%08x
\n
"
,
hr
);
hr
=
INameSpaceTreeControl_AppendRoot
(
pnstc
,
psitestdir
,
SHCONTF_FOLDERS
|
SHCONTF_NONFOLDERS
,
NSTCRS_EXPANDED
,
NULL
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
process_msgs
();
hr
=
INameSpaceTreeControl_GetItemRect
(
pnstc
,
psitestdir
,
&
rc
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
rc
.
top
!=
rc
.
bottom
,
"Got 0 height.
\n
"
);
ok
(
rc
.
left
!=
rc
.
bottom
,
"Got 0 width.
\n
"
);
height
=
0
;
hwnd_tv
=
get_treeview_hwnd
(
pnstc
);
if
(
hwnd_tv
)
{
HTREEITEM
hroot
=
(
HTREEITEM
)
SendMessageW
(
hwnd_tv
,
TVM_GETNEXTITEM
,
TVGN_ROOT
,
0
);
ok
(
hroot
!=
NULL
,
"Failed to get root.
\n
"
);
if
(
hroot
)
{
RECT
tv_rc
;
BOOL
bret
;
*
(
HTREEITEM
*
)
&
tv_rc
=
hroot
;
bret
=
SendMessageW
(
hwnd_tv
,
TVM_GETITEMRECT
,
FALSE
,
(
LPARAM
)
&
tv_rc
);
ok
(
bret
,
"TVM_GETITEMRECT failed.
\n
"
);
/* The NamespaceTreeControl returns screen coordinates. */
MapWindowPoints
(
NULL
,
hwnd
,
(
POINT
*
)
&
rc
,
2
);
ok
(
rc
.
left
==
tv_rc
.
left
,
"Differed, got %d and %d
\n
"
,
rc
.
left
,
tv_rc
.
left
);
ok
(
rc
.
top
==
tv_rc
.
top
,
"Differed, got %d and %d
\n
"
,
rc
.
top
,
tv_rc
.
top
);
ok
(
rc
.
right
==
tv_rc
.
right
,
"Differed, got %d and %d
\n
"
,
rc
.
right
,
tv_rc
.
right
);
ok
(
rc
.
bottom
==
tv_rc
.
bottom
,
"Differed, got %d and %d
\n
"
,
rc
.
bottom
,
tv_rc
.
bottom
);
/* Save the height and compare to that of other items.
Observed values: 18, 19, 21 */
height
=
rc
.
bottom
-
rc
.
top
;
trace
(
"height: %d
\n
"
,
height
);
}
}
else
win_skip
(
"Skipping some GetItemRect tests.
\n
"
);
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