Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reading and selecting items in a list box
#4
Oops, one last problem. It turns out that I can't just use a.Select(SELFLAG_ADDSELECTION) to select each list item, because there's another part of this application that needs to detect the actual click of the mouse on the list item, in order to enable something else.

Usually that's no problem, because I can just click on the list item, like this:

Code:
Copy      Help
Acc a=acc("listname" "LIST" windowname "WindowsForms10.LISTBOX.app.0.378734a" "" 0x1000)
for a.elem 1 20
,str thiselem=a.Name; err break
,if Need_To_Select(thiselem)
,,a.Mouse(1)

But sometimes the list is too long to fit in its list box, so a scroll bar appears. Then, when I try to click on a desired list item that's not visible (because I would need to scroll down to it) I get an error message.

I found LVM_ENSUREVISIBLE, but I'm not sure it works with this type of list box. This doesn't seem to help at all:

Code:
Copy      Help
Acc a=acc("listname" "LIST" windowname "WindowsForms10.LISTBOX.app.0.378734a" "" 0x1000)
Acc wholebox=a
for a.elem 1 20
,str thiselem=a.Name; err break
,if Need_To_Select(thiselem)
,,item=child(wholebox)
,,SendMessage item 0x00001013 i 0
,,probe.Mouse(1)
,,a.Mouse(1)

Am I using this SendMessage wrong, or do I need an entirely different command? I apologize for the followup question... thanks in advance.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)