Okay, that would be good enough, but it doesn't really work.
The problem is that STATE_SYSTEM_SELECTED evaluates to '2', while ElementGetState returns either 2097152 (2^21) if the item is not selected and 2097154 (2^21+2) if the item is selected !!
So, am I supposed to play around with bit masks for this comparison to work, or what am I doing wrong ?
Many thanks
Code: Select all
element = Ranorex.ControlGetElement(listViewHwnd)
itemCount = Ranorex.ElementFindChildren(element,Ranorex.ROLE_SYSTEM_LISTITEM,
None,None,Ranorex.MATCH_EXACT)
for idx in range(itemCount):
childE = Ranorex.ElementGetChildFieldItem(idx)
bla = Ranorex.ElementGetState(childE) # for debugging
bli = Ranorex.STATE_SYSTEM_SELECTED # for debugging
if Ranorex.ElementGetState(childE)==Ranorex.STATE_SYSTEM_SELECTED:
break
# for