1

I have to select all items from an external program Listview control. Does anybody know how can I accomplish this? I tried with SendCommand, but failed.

In AutoIt I can do it this way:

ControlListView("Title", "", "[CLASS:SysListView32; INSTANCE:1]", "Selectall")

Thanks!

Stan Dragos
  • 31
  • 1
  • 4

1 Answers1

1

You'll need to send a message to the control using with Win32 SendMessage API.

There is an example of exactly this right here.

You will of course have to find the window handle of the control, provided you know the class and window name (which you can find with Spy++) you can probably do it with FindWindowEx.

mdm
  • 12,480
  • 5
  • 34
  • 53
  • Thanks for the example, but I managed to use just LVM_GETSELECTEDCOUNT to get the number of selected items from my listview. The LVM_SETITEMSTATE gives me an "Type mismatch" error. – Stan Dragos Jun 15 '11 at 09:22
  • @Stan: You are using incompatible `SendMessage` on your second call. Update question with some code if you need more pointers. – wqw Jun 17 '11 at 13:38