Jump to content

uTorrent - SysListView32


amuskie
 Share

Recommended Posts

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)

Link to comment
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.

 

Spoiler

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

Spoiler

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

Link to comment
Share on other sites

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
Link to comment
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...

 

Spoiler

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

Spoiler

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

Link to comment
Share on other sites

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
Link to comment
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.

Edited by Valik
Link to comment
Share on other sites

  • 6 years later...

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.

Link to comment
Share on other sites

  • Moderators

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!

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