Sign in to follow this  
Followers 0
amuskie

uTorrent - SysListView32

11 posts in this topic

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)

Share this post


Link to post
Share on other sites



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.


Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

#3 ·  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

Share this post


Link to post
Share on other sites

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


Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

#5 ·  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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

I've raised a ticket and reported as a bug.

Share this post


Link to post
Share on other sites

#8 ·  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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.


√-1 2^3 ∑ π, and it was delicious!

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  
Followers 0