Nikolay Sivov : shell32/shellview: Implemented IFolderView::GetFocusedItem.
Alexandre Julliard
julliard at winehq.org
Mon Mar 15 12:19:36 CDT 2010
Module: wine
Branch: master
Commit: 8c92ba009d2aec43df3d483abf30f3c09d850f53
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8c92ba009d2aec43df3d483abf30f3c09d850f53
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sat Mar 6 23:55:32 2010 +0300
shell32/shellview: Implemented IFolderView::GetFocusedItem.
---
dlls/shell32/shlview.c | 10 +++++++---
dlls/shell32/tests/shlview.c | 13 +++++++++++++
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c
index 8778dbd..f718c2b 100644
--- a/dlls/shell32/shlview.c
+++ b/dlls/shell32/shlview.c
@@ -2750,9 +2750,13 @@ static HRESULT WINAPI IFView_GetSelectionMarkedItem(IFolderView *iface, int *ite
static HRESULT WINAPI IFView_GetFocusedItem(IFolderView *iface, int *item)
{
- IShellViewImpl *This = impl_from_IFolderView(iface);
- FIXME("(%p)->(%p), stub\n", This, item);
- return E_NOTIMPL;
+ IShellViewImpl *This = impl_from_IFolderView(iface);
+
+ TRACE("(%p)->(%p)\n", This, item);
+
+ *item = SendMessageW(This->hWndList, LVM_GETNEXTITEM, -1, LVNI_FOCUSED);
+
+ return S_OK;
}
static HRESULT WINAPI IFView_GetItemPosition(IFolderView *iface, PCUITEMID_CHILD pidl, POINT *ppt)
diff --git a/dlls/shell32/tests/shlview.c b/dlls/shell32/tests/shlview.c
index fd65e49..2cd4c4b 100644
--- a/dlls/shell32/tests/shlview.c
+++ b/dlls/shell32/tests/shlview.c
@@ -303,6 +303,11 @@ static const struct message folderview_getselectionmarked_seq[] = {
{ 0 }
};
+static const struct message folderview_getfocused_seq[] = {
+ { LVM_GETNEXTITEM, sent|wparam|lparam, -1, LVNI_FOCUSED },
+ { 0 }
+};
+
static void test_IShellView_CreateViewWindow(void)
{
IShellFolder *desktop;
@@ -379,6 +384,7 @@ if (0)
/* crashes on XP */
hr = IFolderView_GetSelectionMarkedItem(fv, NULL);
+ hr = IFolderView_GetFocusedItem(fv, NULL);
}
browser = IShellBrowserImpl_Construct();
@@ -435,6 +441,13 @@ if (0)
ok_sequence(sequences, LISTVIEW_SEQ_INDEX, folderview_getselectionmarked_seq,
"IFolderView::GetSelectionMarkedItem", FALSE);
+ /* IFolderView::GetFocusedItem */
+ flush_sequences(sequences, NUM_MSG_SEQUENCES);
+ hr = IFolderView_GetFocusedItem(fv, &ret);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+ ok_sequence(sequences, LISTVIEW_SEQ_INDEX, folderview_getfocused_seq,
+ "IFolderView::GetFocusedItem", FALSE);
+
IShellBrowser_Release(browser);
IFolderView_Release(fv);
IShellView_Release(view);
More information about the wine-cvs
mailing list