Click to See Complete Forum and Search --> : Lvn_odfinditem


joonas
December 26th, 2004, 08:12 AM
Hello,

I'm building a Winamp plugin with a virtual listview and want to use LVN_ODFINDITEM so that the listview will jump accordingly if you type the beginning of the words...for some reason though it always jumps to the first item (that is index = 0) no matter what I return....

I know this could be tricky to solve with so little but if anyone ever experienced this and now how to solve it, plz share :)

Thanks!

/Joonas

NoHero
December 26th, 2004, 08:27 AM
The MSDN does not explicity say if it moves the top index to the found item or not. But I think using LMV_ENSUREVISIBLE (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/listview/messages/lvm_ensurevisible.asp) does the same good enough:


// Move to item with index nr. 20
// And it must be completly visible, the third parameter FALSE specifies that
ListView_EnsureVisible(hwnd_ListView, 20, FALSE);

joonas
December 26th, 2004, 11:28 AM
The MSDN does not explicity say if it moves the top index to the found item or not. But I think using LMV_ENSUREVISIBLE (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/listview/messages/lvm_ensurevisible.asp) does the same good enough:


// Move to item with index nr. 20
// And it must be completly visible, the third parameter FALSE specifies that
ListView_EnsureVisible(hwnd_ListView, 20, FALSE);


No, you misunderstand...it always jumps to the top index...the very first top index...the one with index = 0. not just the top of the visible...and it jumps to that index even if I set it to jump to another number...like return 6 -> still jumps to the top...

And I don't want it to jump there ;)

/Joonas

NoHero
December 26th, 2004, 11:31 AM
I understand. But I have never faced any problems with that. Does the LVM_ENSUREVISIBLE provide help though?

NoHero
December 26th, 2004, 11:33 AM
Can you post full code? So I can take a look at it and test it on my machine?

joonas
December 26th, 2004, 12:26 PM
Can you post full code? So I can take a look at it and test it on my machine?

I've solved it! Forgot that I am running this in a dialog procedure...had to put the result with SetWindowLong(hwndDlg, DWL_MSGRESULT, result) and not just return.

Thanks for trying though! Appreciate it! :)

/Joonas