I am developing an automation tool(C++) for which I need to write program to Click,Doubleclick on the Listview item by using the Handle of the listview control and index of the item. (Win32/C++).Kindly help.
Last edited by haroonrulz; January 2nd, 2013 at 09:04 AM.
Sorry pal, but I have no answers to your assignment. Clicking itself is the easiest part here. The most tricky thing is determining item rectangle in the listview window. There's no straightforward Win API to find that out, as far as I know. So good luck in your research.
Look at LVM_GETITEMRECT message. This returns a RECT structure containing the bounding rectangle for the specified index of the listview item. Note that using SendInput as suggested by Igor requires absolute coordinates for the mouse position for the MOUSEINPUT structure to position the mouse before issuing a click. You'll have to convert the info in the RECT structure into absolute x, y co-ordinates before using SendInput. Good luck!
Bookmarks