Jump to content
Sign in to follow this  

need help detecting item in listbox

Recommended Posts


I am trying to write a script that when you are on a LAN Connection's properties page (where you see all the microsoft client, ipv4, ipv6 properties)

I need to make my script select a specific item and uinstall it, I'm fine with sending keystrokes, however not every pc might have the same items in this list, is there any way to detect the text of the item selected in that box? from looking at it i might be able to use the window text as when you select differnt items in the list, different window text is visible via auto window info tool, but i'm not sure how to write a function that could check to see if the current windows text contains a certain string (ie: contains the string but not an exact match of all of the visible text)

Share this post

Link to post
Share on other sites

nevermind, i think i got it:

winwaitactive("Local Area Connection Properties")
$testvar = WinGetText("Local Area Connection Properties")

$i = 0
$swindowtext = "Allows your computer to"
msgbox(0,"text read was:",$testvar);debugging purposes

if stringinstr ($testvar, $swindowtext) = 0 then
$i = 1

Until $i = 1

msgbox(0,"Found string")

which should work for what i want, anyone know what to do, but does anyone have any pointers for detecting text in situations like that? for example if i wanted to make a script that started add/remove programs and selected a particular program and then click remove? or is that a little out of the scope of what we can do here.

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