Jump to content

Recommended Posts

Posted

I tried to use AutoIT to automate the uTorrent. When I got a torrent file, uTorrent will open it and check its content (i.e. only download for .iso, .rar, .pdf etc) filter out the other. My problem is I cant retrieve those filenames under the SysListView32.

I could get the filesize under column 2 (item 1) but nothing under column 1 (item 0). Any help?

Ive been using 3 function and they all failed to get the data out. Below is the extract from window control info, my script and the screen dump.

Posted Image

Posted Image

>>>> Control <<<<

Class: SysListView32

Instance: 1

ClassnameNN: SysListView321

Advanced (Class): [CLASS:SysListView32; INSTANCE:1]

ID: 1206

Text:

Position: 23, 218

Size: 379, 96

ControlClick Coords: 243, 51

Style: 0x50211009

ExStyle: 0x00000200

Handle: 0x00380232

$hWnd = WinGetHandle("[CLASS:#32770]", "Save As")

ControlFocus($hWnd, "", 1206)

ControlListView($hWnd, "", 1206, "Selectclear")

ControlListView($hWnd, "", 1206, "Select",0)

$hListView = ControlGetHandle($hWnd,"",1206)

ControlListView($hWnd, "", 1206, "GetText",0,0)

_GUICtrlListView_GetItemTextString($hListView, 0)

GUICtrlListView_GetItemText($hListView,, 0, 0)

Posted

Try this:

#include <GuiListView.au3>

$hWnd = WinGetHandle("[CLASS:#32770]", "Save As")
ControlFocus($hWnd, "", "SysListView321")
ControlListView($hWnd, "", "SysListView321", "Selectclear")
ControlListView($hWnd, "", "SysListView321", "Select", 0)
$hListView = ControlGetHandle($hWnd, "", "SysListView321")

$iIndex = ControlListView($hWnd, "", "SysListView321", "GetSelected")
$sText1 = _GUICtrlListView_GetItemTextString($hListView, $iIndex)
$sText2 = _GUICtrlListView_GetItemText($hListView, $iIndex, 0)

MsgBox(0, "", $sText1 & @LF & $sText2)

If it's not working, then post here the link to the torrent, i will test it.

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted (edited)

MrCreatoR,

Thanks for the help. I just tried your code but still not working. Please try this torrent (with no foreign character filename inside):

Btw, I'm using the uTorrent v1.8.

Cheers!

Edited by SmOke_N
Removed link
Posted

Hm, that's a strange indeed. The first subitem can't be read :) - I am not sure, but maybe the current selection can be read from the label?

$sText = ControlGetText("[CLASS:#32770]", "Save as", "Static3")

ConsoleWrite($sText)

And then you could get all the items by using a loop and select every item and get a current text from the label...

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted (edited)

MrCreatoR,

Thanks for the prompt response. I tried your new code but it only worked for that specific torrent I gave you earlier.

Please check with these 2 captures, the filename don't even show up under "Static3".

Posted Image

Posted Image

fyi, the torrent link is under:

Cheers!

Edited by SmOke_N
Removed link
Posted

Found the problem: My computer has good taste and refuses to play Celine Dion and Metallica under any circumstances! :)

Posted (edited)

The list-view data is managed by the program itself (it has LVS_OWNERDATA set). That means data is not stored or accessed in the standard way. There is a second, different way to access the data and the code you are using does not try the alternate way. The control is what's called a "Virtual List-View" and you can find information on MSDN for how to work with it.

Edit: I strongly suggest you remove the torrent links. Common sense should have been the order of the day and you should have created a dummy torrent since it's only important to access the "Add new torrent" screen. What you've done here by linking to those two torrents is a bannable offense.

Edited by Valik
  • 6 years later...
Posted

  On 9/15/2008 at 4:59 PM, Valik said:

The list-view data is managed by the program itself (it has LVS_OWNERDATA set). That means data is not stored or accessed in the standard way. There is a second, different way to access the data and the code you are using does not try the alternate way. The control is what's called a "Virtual List-View" and you can find information on MSDN for how to work with it.

Edit: I strongly suggest you remove the torrent links. Common sense should have been the order of the day and you should have created a dummy torrent since it's only important to access the "Add new torrent" screen. What you've done here by linking to those two torrents is a bannable offense.

 

how to deal with listview those of "data is not stored or accessed in the standard way"?  It seem very popular. Can you give more details, thx for your kinds.

  • Moderators
Posted

lianhc, you seriously didn't notice this post was more than 6 years old? The language has changed just a touch since 2008, as have the forum rules. Please open a new thread, explain in detail what you're trying to do, and show what you have already tried on your own, rather than necroing old posts.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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
  • Recently Browsing   0 members

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