Jump to content

ControlID / ControlListView Problem


yusuf
 Share

Recommended Posts

Hi all, been using autoit for the last week and am still learning, have created a few scripts without any problem.

I want to make this script work with newsleecher (a usenet binary downloader), I haven't had a problem getting the controlID from all other programs but newsLeecher is a bit funny, as a test I just want to select (highlight) the items in the list before I progress and develop the script but ain't getting any luck, here's a sample

Opt("WinTitleMatchMode",2)
$t = "NewsLeecher"
$C = 67288
WinActivate($t)
ControlListView($t, "", $C, "SelectAll")

$C is the controlid (using the info tool), It activates my newsleecher window, but doesn't highlight the items in the list, I also tried substituting the control id for the classname e.g $C = "TVirtualExplorerTreeview1" but no luck, I know what you are thinking, it isn't a list but it is, Please if anyone here is using Newsleecher or could care to download and test it you'll know what I'm talking about.

Here's some screens, the first one I put a red border to indicate the control I'm trying to interact with.

Posted Image

The second screen has the window info tool open, the thing is when I move the mouse around in that list (the red border) it changes alot, there are plenty of other controlids within the red border, its the ONLY program that does this, hope you can help, thanks.

Posted Image

Edited by yusuf
Link to comment
Share on other sites

Someone help, I'm sure its a common problem, can anybody point me in the right direction? or know exactly what can resolve this.

Or should I try AutoHotKey? do you think I would have a similar problem using that?

I await your comments, ty.

Link to comment
Share on other sites

  • Moderators

You could start by trying to use the right functions... I am not going much further than this, because the post is so large.

You are using ControlListView for a TreeView Control.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Thanks smoke, the question isn't that long, its just 2 (huge (sorry)) images.

Like I said before its not really a TreeView item but I took your suggestion and tried anyway.

#include<GuiTreeView.au3>
Opt("WinTitleMatchMode",2)
$t = "NewsLeecher"
$C = 67288
WinActivate($t)
$a = _GUICtrlTreeViewGetCount($C)
;ControlListView($t, "", $C, "SelectAll")
MsgBox (0, "Test", "Amount of Entries: " & $a)

The controllistview is commented out and now I'm using _GuiCtrlTreeViewGetCount instead to see if I can get a count of how many items are in the list but it keeps returning 0 (there's plenty in the list, look at the screens), any other suggestions?

Link to comment
Share on other sites

  • Moderators

Note: AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation. Experiment!

If ControlListView() isn't working, then you could possible try the below:

http://www.autoitscript.com/forum/index.ph...ic=9988&hl=

GL

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Wow, after 4 pages worth of reading, I never knew this was such a big problem.

Thanks for the help.

When I have enough time I'll try installing the dll or might wait til its built in and there's alot more documentation.

Link to comment
Share on other sites

  • Moderators

Wow, after 4 pages worth of reading, I never knew this was such a big problem.

Thanks for the help.

When I have enough time I'll try installing the dll or might wait til its built in and there's alot more documentation.

I'd be willing to bet your issue lies in the first part of my post (the help file quote) rather than the 2nd part that you're hoping to be built in.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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