Frescard Posted February 6, 2013 Posted February 6, 2013 (edited) 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. Edited February 6, 2013 by Frescard
KaFu Posted February 6, 2013 Posted February 6, 2013 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. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Frescard Posted February 7, 2013 Author Posted February 7, 2013 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")
KaFu Posted February 7, 2013 Posted February 7, 2013 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. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Frescard Posted February 7, 2013 Author Posted February 7, 2013 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.
junkew Posted February 9, 2013 Posted February 9, 2013 see If its based on a standard control you should be able to get some stuff with ui automation FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
ledigeine Posted January 15, 2015 Posted January 15, 2015 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.
MikahS Posted January 15, 2015 Posted January 15, 2015 (edited) 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 January 15, 2015 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy 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
ledigeine Posted January 15, 2015 Posted January 15, 2015 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. Tried that, compiled to 64bit and ran it on win7. Works fine. moved it to my 8.1 and it gives me an error. Unable to open the script file.
MikahS Posted January 15, 2015 Posted January 15, 2015 (edited) 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 January 15, 2015 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy 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
ledigeine Posted January 15, 2015 Posted January 15, 2015 No f7, i was using the compile tool in the start menu. AV should be the same for both computers since they're on the same network here at work. I'll look at this more.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now