Dear Experts,
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.
Printable View
Dear Experts,
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.
Really? As long as click is a general user input action in Windows, if you know how to click listbox, you know how to click anything else.Quote:
As you know clicking an item in Listbox is very easy
Sorry Igor, I have edited my question,kindly help.
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!
The item may not be visible, you may need to use message ListView_EnsureVisible