Jump to content
Sign in to follow this  
Pandaren

uTorrent SysListview322 getting row information

Recommended Posts

Pandaren

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?

Share this post


Link to post
Share on other sites
DW1

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

Share this post


Link to post
Share on other sites
Pandaren

hey danwilli,

i tested your script, but unfortunately it doesn t work, the list is completly empty...

But thanks for spending time in this maybe there is a little error and it will work.

Pandaren

Share this post


Link to post
Share on other sites
DW1

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.

Share this post


Link to post
Share on other sites
Pandaren

i dont really get it...

I have started AutoIt and checkt the ID and they are exactly the same, so what am i doing wrong?

Share this post


Link to post
Share on other sites
picaxe

#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)

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.