Link to home
Start Free TrialLog in
Avatar of xflmlow
xflmlow

asked on

CListCtrl::FindItem

Hi All!

I need to interface with SW already available. (source is not)
I start by obtaining a pointer to the Listview control as follows:

CWnd* pApp = FindWindow(NULL,WindowTitle);
CWnd* pTmp = pApp->GetWindow(GW_CHILD);
CListCtrl* pListView = (ListCtrl*)pTmp->GetWindow(GW_CHILD);

Then I count the items using GetItemCount() (successfully)

The problem arises when I try to find an item using FindItem(&lvInfo)
lvInfo is previously defined as
LV_FINDINFO lvinfo      = {0};
lvinfo.flags = LVFI_PARTIAL | LVFI_STRING;
lvinfo.psz = psItem;

FindInfo refuses to return nothing but -1 allthough the item is present.

Any help apreciated.
Best Regards / Marcus
Avatar of xflmlow
xflmlow

ASKER

Edited text of question.
ASKER CERTIFIED SOLUTION
Avatar of mikeblas
mikeblas

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of xflmlow

ASKER

Thanks for your input mikeblas!

I accept the fact that I do not own the window in question, what I do not understand is why I'm permitted to count and even  delete items from the list (flawlessly), when I can't search it.

Can someone explain that?

/Marcus
The problem is moving memory from one process to another. Moving a value, as in a return code, isn't a problem.

..B ekiM
Avatar of xflmlow

ASKER

OK!
Thanks.