Jump to content

controlListView "findItem"


 Share

Recommended Posts

what if there is multiple items all the same but at different levels in the list . . .it just keeps returning the first item found

Link to comment
Share on other sites

  • Moderators

How can we help when we don't even know if it's a native ListView or what application it's on... I mean really... vasectomy/unich you choose.

Func _CLVFindItem($hWnd, $sCText, $sLV, $sFindItem, $nItem = -1)
    If ControlListView($hWnd, $sCText, $sLV, 'SelectAll') = 0 Then Return SetError(1, 0, -1)
    Local $nGetCount = ControlListView($hWnd, $sCText, $sLV, 'GetSelectedCount', 0)
    For $iCC = 0 To $nGetCount - 1;$iCC will be the control number
        If ControlListView($hWnd, $sCText, $sLV, 'GetText', $iCC) = $sFindItem Then
            If $nItem = -1 Then Return $iCC
            If $nItem <> $iCC Then Return SetError(2, 0, -1)
        EndIf
    Next
    Return SetError(3, 0, -1)
EndFunc

You could Mod the above... instead of If $nItem = -1 Then Return $iCC you could do If $nItem = -1 Then $sHoldNum = $sHoldNum & @LF

Then where it says Return SetError(3,0,-1) you could return a 1 Dimensional array Return StringSplit(StringTrimRight($sHoldNum, 1), @LF)

(Before anyone comments on $sHoldNum = $sHoldNum vs $sHoldNum &= ... I don't want to confuse him anymore than he's done us.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

why donot you doit on an explorer search results for files named sys on your computer and send me the script

as for me i do understand what u r doing and thanks for ur effort

Link to comment
Share on other sites

thanks i got it somehow u helped me i did it with the gettext option in a "for....Next" loop . thanks u guys for ur help

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...