Is there a way to look for specific text within a listview control, and if found, move the cursor on top of this text?
I am trying to search through a list of rows (would could be quite a long list) to find a value (within a specific column) that matches a user input. If found, I want to right click on this value to bring up it's popup menu.
Cheers
Moving Mouse Cursor To Specific Text Within Listview Control
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
GetListItem will return the index in the list of a specified piece of text. So you could use that to get the index and then you know how many rows to move down from the top (I would use key strokes to do that rather than mouse events).
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
If it's non-standard then GetListItem won't work and we probably can't use Win32 API calls either.
If the text is always visible then you might be able to use the GetTextInRect function. Set up a loop that looks at a rectangle representing a row in the list. You only need do it once and offset the y position each time as the loop iterates, so that you end up scanning each row.
If the text is always visible then you might be able to use the GetTextInRect function. Set up a loop that looks at a rectangle representing a row in the list. You only need do it once and offset the y position each time as the loop iterates, so that you end up scanning each row.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?