Jump to content

Use more then one word for WinExists and Winclose


Recommended Posts

If winexists("","Chat") then Winclose("","Chat")

I want to be able to use more than one keyword. Such as Winexists("","Chat","chat","MySpace") then Winclose("","Chat,"chat""MySpace")

Any ideas?

Edited by Klexen
Link to comment
Share on other sites

This is what I got, how do I get it to close if either is open?

If I have it like this the program crashes.

AdlibEnable("killchat")
$killchat = "Chat"
$killmyspace = "MySpace"
while 1
    sleep(1000)
    WEnd
Func killchat()
    if WinExists("",$killchat) And WinExists("",$killmyspace) then winclose("",$killchat) and winclose("",$killmyspace)
sleep(1000)

EndFunc
Edited by Klexen
Link to comment
Share on other sites

Not tested

AdlibEnable("killchat")
$killchat = "Chat"
$killmyspace = "MySpace"
While 1
    Sleep(1000)
WEnd
Func killchat()
    If WinExists("", $killchat) Then WinClose("", $killchat)
    If WinExists("", $killmyspace) Then WinClose("", $killmyspace)
    Sleep(1000)
EndFunc   ;==>killchat

8)

I could have sworn I tried that before. I think when I did that Igoogled the word "chat" and since it wasnt Chat it didn't work, so I thought I did something wrong. Thanks a lot Valuater.

I noticed it doesn't read the words chat in a webpage such as this form. Is it possible to do that with the WinExists or similar command?

CODE

AdlibEnable("killchat")

$killchat = "Chat"

$killmyspace = "MySpace"

$killchat2 = "chat"

While 1

Sleep(1000)

WEnd

Func killchat()

If WinExists("", $killchat) Then WinClose("", $killchat)

If WinExists("", $killchat2) Then WinClose("", $killchat2)

If WinExists("", $killmyspace) Then WinClose("", $killmyspace)

Sleep(1000)

EndFunc ;==>killchat

Link to comment
Share on other sites

In help File

WinTitleMatchMode Alters the method that is used to match window titles during search operations.

1 = Match the title from the start (default)

2 = Match any substring in the title

3 = Exact title match

4 = Advanced mode, see Window Titles & Text (Advanced)

-1 to -4 = force lower case match according to other type of match.

In autoit it would be

Opt("WinTitleMatchMode",2)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...