Sign in to follow this  
Followers 0
FaridAgl

Read Control String and match them for serveral windows

4 posts in this topic

Guys i need some help here.

For example i have 20 Notepad running, Minimized, Maximized, Active and Inactive. Each of them have different text inside. I want check all of them and close only each of them that have a string that i will declare.

Another thing is a little more Complex:

I want to check the string of a Control in a for example 20 same window and close each of them that the string of that control is my declared string and don't touch each of them?

special tnx for any help.

Share this post


Link to post
Share on other sites



Use WinList, ControlGetText, compare the texts and use WinClose.


Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

yes i think it's working, if i had any problem i will post here. tnx so much.

Share this post


Link to post
Share on other sites

sry if i bumped my topic. it's what i finaly write but it seems have some problem.

i run a program 12 times and each of them have different title, i can't explain it good but plz take a look on it and improve my codes.

$InputBoxUsername = InputBox("GoDLiKe.eXp", "Enter the Username you want to close:", "", " 15", 275, 125)
$Windows = WinList()
 
For $i = 1 to $Windows[0][0]
  If $Windows[$i][0] <> "" Then
$Username = ControlGetText($Windows[$i][0],"UID:","[CLASS:Static; INSTANCE:1]")
If $Username = $InputBoxUsername Then
If $Username NOT = "" Then
ProcessClose(WinGetProcess($Windows[$i][0]))
EndIf
EndIf
  EndIf
Next

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  
Followers 0