dioce Posted February 17, 2014 Share Posted February 17, 2014 Hello, I am having an issue with installing a program. One section of the install has a SysListView32 window that I have to scroll thru to select my line item. I have tried GUICtrlListView_EnsureVisible, GUICtrlListView_SetItem, ControlListView, and GUICtrlListView_ClickItem to select/highlight a name in the list. I cannot figure it out. The only thing I can do is use Send("{Down 27}") to get what I need done. I do not want to use that because I cannot be sure that the item will always be the 27th item in the list. Any thoughts on how this can be done? Or different commands to try? Thanks. Link to comment Share on other sites More sharing options...
spudw2k Posted February 18, 2014 Share Posted February 18, 2014 (edited) Without seeing any example code it's a little hard to work from. Just an initial tip on how I would begin troubleshooting it; check what values are returned from the _GUICtrlListView funcs you are using (0,1, @error). edit: Also, you may want to try both x86 and x64 autoit interpreters. Is the install running with Admin privs? Make sure the script is also running as admin if that is the case (#RequireAdmin) Edited February 19, 2014 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
dioce Posted February 19, 2014 Author Share Posted February 19, 2014 Here is that section of script I am currently running: #include <guicombobox.au3> Run("c:\windows\system32\odbcad32.exe") sleep(1000) WinWait("ODBC Data Source Administrator") sleep(1000) Send("+{TAB}") Send("{RIGHT 2}") sleep(10000) WinWait("ODBC Data Source Administrator") sleep(15000) controlclick("ODBC Data Source Administrator", "", "[CLASS:Button; INSTANCE:2]") sleep(2000) WinWait("Create New Data Source") Send("{Down 27}") sleep(1000) controlclick("Create New Data Source", "", "[CLASS:Button; INSTANCE:3]") sleep(1000) controlsettext("Create New Data Source", "", "[CLASS:Edit; INSTANCE:1]", "Requistions") sleep(1000) controlclick("Create New Data Source", "", "[CLASS:Button; INSTANCE:4]") sleep(1000) controlclick("Create New Data Source", "", "[CLASS:Button; INSTANCE:5]") I ended up erasing all my other code lines and went back to Send("{Down 27}"). The line I need highlighted is titled SQL Native Client. The script installs the client prior to opening the ODBC in Windows. It is running as admin under x86. I will try to readd the funcs tonight and troubleshoot it. Link to comment Share on other sites More sharing options...
dioce Posted February 20, 2014 Author Share Posted February 20, 2014 Ok. I am either getting lost or in over my head. All the return values came back as 0 (if I did it right). I was trying to use _GUICtrlListView_EnsureVisible using the control ID and list name and sometimes line number with it. I am not setting it up as variables because this is the only location I need those numbers. Is this the problem? Do i need to create it with variables? The SysListView32 window does not have specified lines in it or any hidden text to use as a search function. Is it even possible to scroll or select in a window like that? Also the script has #include <guilistview.au3> at the top. I forgot to copy that line. Thanks for any input on this. Link to comment Share on other sites More sharing options...
spudw2k Posted February 21, 2014 Share Posted February 21, 2014 You could also try using ControlGetHandle to obtain the handle of the syslistvie and feed that to the _GUICtrlListView funcs. Also I am thinking there may be a quicker way to get to the punchline (desired end result). Are you ultimately automating the creation of an ODBC source/link? I may be mistaken, but I believe all ODBC sources that are created using ODBC Source Administrator are ultimately Registry values. It would be much simpler and probably faster to simply create the registry keys and values rather than dealing with automating a GUI. My recommendation would be to create the ODBC source by hand, then find the registry keys/values that are created and script the registry portion directly. >Here's a link of a old example that points to the ODBC sources in the registry and lists them (needs to be modified to display 32-bit sources using SoftwareWow6432Node). While I enjoy the process of GUI automation and I find it good scripting practice, sometimes the shortcut solution is more effective, simpler and has less room for failure; but that's just me. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
dioce Posted February 21, 2014 Author Share Posted February 21, 2014 Never even thought about going thru the registry. It will probably be Monday or Tuesday sometime but I will try that out. I will let you know how that works out. Thanks! Link to comment Share on other sites More sharing options...
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