Jump to content

uTorrent SysListview322 getting row information


Recommended Posts

hey guys,

i tried to get the row information of an item in utorrent.

MsgBox(0, "", ControlListView("µTorrent 2.0.2", "", "SysListView322", "GetText", 0, 4));

However it doesn't work. When i try this:

MsgBox(0, "", ControlListView("µTorrent 2.0.2", "", "SysListView322", "GetItemCount"));

everything went absolutely fine and also adding items will give me the exact value of items. But only "GetText" doens't work and

im getting no return in my MsgBox. I also tried the same code on other programs and it works fine...

Does anyone know whats the problem?

Link to comment
Share on other sites

This picked them all up for me... I used the Control ID though, since it remained static. The instance of the listviews keep changing, so it is unreliable to use "SysListView322".

#include <array.au3>

$Array = Utorrent("Status")
If IsArray($Array) Then _ArrayDisplay($Array)

$Array = Utorrent("Torrents")
If IsArray($Array) Then _ArrayDisplay($Array)

Func Utorrent($Data)
    If $Data <> "Status" And $Data <> "Torrents" Then Return 0
    If $Data = "Status" Then $Data = 1259
    If $Data = "Torrents" Then $Data = 27
    $num = ControlListView("µTorrent 2.0.2", "", $Data, "GetItemCount")
    $sub = ControlListView("µTorrent 2.0.2", "", $Data, "GetSubItemCount")
    Local $aTorrents[$num][$sub]
    For $a = 0 To $num - 1
        For $b = 0 To $sub - 1
            $aTorrents[$a][$b] = ControlListView("µTorrent 2.0.2", "", $Data, "GetText", $a, $b)
        Next
    Next
    Return $aTorrents
EndFunc   ;==>UtorrentList
Edited by danwilli
Link to comment
Share on other sites

You need to replace the "27" and "1259" in the script with the control ID's that you see in the AutoIt Info Tool.

Since these are apparently NOT static, to make this work universally, we would need to get the controlID by position of controls... search around for something similar, I would, but I have to go to school.

Good luck.

Link to comment
Share on other sites

#include <GuiListView.au3>
$sDelim = "|"
$hListview = ControlGetHandle("µTorrent 2.0.2", "", "[CLASS:SysListView32; INSTANCE:2]")
$sItems = ""
For $i = 0 To _GUICtrlListView_GetItemCount($hListview) - 1
    For $j = 0 To _GUICtrlListView_GetColumnCount($hListview) - 1
        $sItems &= _GUICtrlListView_GetItemText($hListview, $i, $j) & $sDelim
    Next
    $sItems = StringTrimRight($sItems, 1) & @CRLF
Next
ConsoleWrite($sItems)

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...