Jump to content
Sign in to follow this  
dioce

SysListView32 Window

Recommended Posts

dioce

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.

Share this post


Link to post
Share on other sites
spudw2k

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 by spudw2k

Share this post


Link to post
Share on other sites
dioce

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.

Share this post


Link to post
Share on other sites
dioce

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.

Share this post


Link to post
Share on other sites
spudw2k

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.

Share this post


Link to post
Share on other sites
dioce

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!

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.