Sign in to follow this  
Followers 0
jslegers

Is WinExisist case sensitive ?

6 posts in this topic

Hi,

I have a question. Is the function WinExists case sensitive ? If I use

If WinExists("wordpad") Then WinKill("wordpad")oÝ÷ Ú+]¡ë'ßÛp¢¹ºØ"ëjëh×6If WinExists("WordPad") Then WinKill("WordPad")

it works. I have used the option Opt ("WinTitleMatchMode",2) but it doesn't work. Is there an option for case sensitivity ?

Kind regards,

John Slegers

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi,

you can try this:

If WinExists(WinGetHandle("autoit Help", "")) Then MsgBox(0,"","Found!")

So long,

Mega

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Hi,

you can try this:

If WinExists(WinGetHandle("autoit Help", "")) Then MsgBox(0,"","Found!")

So long,

Mega

If have tried it but it didn't work.

Regards John

Share this post


Link to post
Share on other sites

as far as i know it is case sensitive

Run("notepad.exe")
WinWaitActive("")


If WinExists("untitled -") Then
    MsgBox(0, "non-caps", "Window exists")
EndIf

If WinExists("Untitled -") Then
    MsgBox(0, "with caps", "Window exists")
EndIf

there are no further options... that i am aware of than...

WinExists ( "title" [, "text"] )

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

it works. I have used the option Opt ("WinTitleMatchMode",2) but it doesn't work. Is there an option for case sensitivity ?

No simple setting to switch to insensitive. AutoIt Beta supports regular expressions in titles so can be feasiable to use to suppress case sensitivity, otherwise the concept is not available by efficent means.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

HI,

I did some a bit testing. Not very cute, but ...

#include<array.au3>
Global $window_Array[1]

$window = "dokument - wordpad"
checkWin()

;ConsoleWrite(_ArrayToString($window_Array, @CR))

Func checkWin()
    Global $var = WinList()
    For $i = 1 To $var[0][0]
        If $var[$i][0] <> "" Then _ArrayAdd($window_Array, $var[$i][0])
        Next
    If _ArraySearch($window_Array, $window, 0, 0, 0) <> - 1 Then
        MsgBox(0, "", "Found!")
    Else
        MsgBox(0, "", "Not Found!")
    EndIf
EndFunc   ;==>checkWin

Edit: Must be the exact title but not case sensetive. :D

So long,

Mega

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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