Jump to content

Recommended Posts

  • Moderators
Posted

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.

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
×
×
  • Create New...