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,WindowTitl e);
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
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,WindowTitl
CWnd* pTmp = pApp->GetWindow(GW_CHILD);
CListCtrl* pListView = (ListCtrl*)pTmp->GetWindow
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
..B ekiM
ASKER
OK!
Thanks.
Thanks.
ASKER