Jump to content

Cannot get TreeView text anymore


 Share

Recommended Posts

I used to have a script that was able to sucessfully read the data from a TreeView, but somehow this list was changed, and while I am still able to set the cursor on the desired line, and read the number of items in the list, executing "GetText" will always come back empty, and sets @error to 1:

; "GetItemCount" returns the correct count:
$count = ControlTreeView($title,"",$treeID,"GetItemCount")
; "Select" activates the correct line
ControlTreeView($title,"",$treeID,"Select","#4")

; But none of these variations return anything but an error
$text = ControlTreeView($title,"",$treeID,"GetText")
$text = ControlTreeView($title,"",$treeID,"GetText",4)
$text = ControlTreeView($title,"",$treeID,"GetText",4,0)
$text = ControlTreeView($title,"",$treeID,"GetText","")
$text = ControlTreeView($title,"",$treeID,"GetText","#4")
$text = ControlTreeView($title,"",$treeID,"GetText","#4","")

Another thing that seems to be strange is that if I select line #2, which looks like it has sub-items, the "GetSubItemCount" command will return 0, and sets @error to 1.

post-68799-0-29753000-1360182251_thumb.g

Edited by Frescard
Link to comment
Share on other sites

Hmmm, control looks interesting. What class does Au3Info report for the control? Also is you script in line with the OS bitwise. Use 32bit-Au3 on 32bit-OS and 64bit-Au3 on 64bit-OS, otherwise some functions for treeview and listview controls will not work.

Link to comment
Share on other sites

AU3Info reports the control as a SysTreeView32, and, as I mentioned, the other commands I tried ("GetItemCount" & "Select") work fine, so I'm pretty confident that I got hold of the correct control.

I got a 64bit system, and the "Compile X64 version" option is checked in the compile menu.

I also just updated to 3.3.8.1 (before I was still on 3.3.6.1), but that didn't help either.

Another thing I tried was accessing it via the CLASS property (instead of the control ID), but still nothing...

$text = ControlTreeView($title,"","[CLASS:SysTreeView32; INSTANCE:2]","GetText","#4")

post-68799-0-39037200-1360197033_thumb.g

Link to comment
Share on other sites

Well, afaik a standard SysTreeView32 control can not have columns, so this has to be a customized (subclassed?) control.

What I just see is that it's INSTANCE:2, what happens if you try this?

$text = ControlTreeView($title,"","[CLASS:SysTreeView32; INSTANCE:1]","GetText","#4")

But I fear everything else is just wild-guessing without having access to the control myself.

Link to comment
Share on other sites

Looks like somebody else was struggling with the same issue I am right now:

It's the same application I am trying to automate (JeppView — which is a commercial application, and I'm afraid they don't have a demo), and the method described *used* to work (at least for the 1st column), but not anymore.

So, it definitely looks like they are using a custom(ized) control. That means we're out of luck, trying to access it?

(The frustrating part is that *some* commands work. If none had any effect it would be much easier to just declare it impossible, but you get to some point, but then not any further...)

I'll keep digging, to perhaps find some freeware app that uses the same kind of control, so that I (and perhaps others) might be able to better troubleshoot the issue.

Link to comment
Share on other sites

  • 1 year later...

I am having an issue too with the treeview and the gettext part of it.

I don't know much about all this stuff but I have been compiling my scrips into 32bit and 64bit exe's. Mostly because I am not sure which is better to use and when. So I just have both options. 

While on windows 7 you can use the 32 or 64 bit exe's just fine. Once going to my 8.1 station, the 64bit file will not gettext from the treeview. The 32 bit one will work just fine. 

So its not all that important to figure out how to fix it.. but I am a bit curious. 

Link to comment
Share on other sites

Just put this at the top of your file:

#Region
#AutoIt3Wrapper_UseX64=n
#EndRegion

That way you can just compile to one exe and it will work across your systems.

Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

Is that the only error you have received? Are you compiling with the F7 key? If not, go back and do so and try it again.

Also, putting #RequireAdmin at the top could help if you are an administrator on that windows 8.1 comp, but that is just a shot in the dark.

EDIT: It could have something to do with your antivirus if that is what is not letting it open.

Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

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