#909 closed Bug (No Bug)
WinActivate / WinExists / WinTitleMatchMode Title Bug
| Reported by: | Owned by: | ||
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.0.0 | Severity: | None |
| Keywords: | Cc: |
Description
Hello,
--1-- Open the AutoIt Help and execute this code line:
WinActivate("Auto")
It does'nt take effect even the WinTitleMatchMode is set on option 2, altough the title is "AutoIt Help". But
WinActivate("AutoIt Help")
works.
--2-- Open your Opera Browser. The title of it in German is "Schnellwahl - Opera", in English I THINK "Speed Dial - Opera"
But this
Opt("WinTitleMatchMode",1) ;without this line too, because its default
If WinExists("Opera") Then MsgBox("","","OK")
execute the Message Box, altough Opera is not at the beginn of the title.
My Setting: German AutoIt 3.3.0.0 + WinXP Pro SP3
Attachments (0)
Change History (7)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
To sum up all:
. WinActivate works not very truly
. WinExists always checks the whole title
comment:3 by , 17 years ago
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
Please use the forums to ask these type of questions before reporting a supposed BUG.
Closing as NOBUG.
Run this script and see the result:
$var = WinList()
For $i = 1 to $var[0][0]
; Only display visble windows that have a title
If stringLeft($var[$i][0],4) = "Auto" Then
ConsoleWrite("Title=" & $var[$i][0] & " Handle=" & $var[$i][1] & @CRLF)
EndIf
Next
ConsoleWrite('>Before: WinGetTitle ( "[Active]" ) = ' & WinGetTitle ( "[Active]" ) & @crlf ) ;### Debug Console
$rc = WinActivate("Auto")
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc = ' & $rc & @crlf & '>Error code: ' & @error & '>Extended code: ' & @extended & @crlf) ;### Debug Console$rc = WinActivate("Auto")
ConsoleWrite('>After: WinGetTitle ( "[Active]" ) = ' & WinGetTitle ( "[Active]" ) & @crlf & @crlf ) ;### Debug Console
ConsoleWrite('>Before: WinGetTitle ( "[Active]" ) = ' & WinGetTitle ( "[Active]" ) & @crlf ) ;### Debug Console
$rc = WinActivate("AutoIt Help")
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc = ' & $rc & @crlf & '>Error code: ' & @error & '>Extended code: ' & @extended & @crlf) ;### Debug Console
ConsoleWrite('>After: WinGetTitle ( "[Active]" ) = ' & WinGetTitle ( "[Active]" ) & @crlf ) ;### Debug Console
comment:4 by , 17 years ago
Well,
I understand, that my Program / Compiler has an "AutoIt" title too, ok - I think this would be worth a comment, that you are not allow to beginn with title "AutoIt"...
But whats with the second problem with WinExists - it works on all windows incorrectly...
follow-up: 6 comment:5 by , 17 years ago
I have used extern tools to investigate this exits problem. Indeed the Opera and some more program has more titles - in this case Opera has 4 titles:
"Website Name - Opera", "Opera", "M", "Default IME". By the way last Title AutoIt also creates.
You've right, is no Bug, but it would be worth to know this background, so you can add this at the official help file, if you think is ok...?
comment:6 by , 17 years ago
Replying to xelotiac@…:
I have used extern tools to investigate this exits problem. Indeed the Opera and some more program has more titles - in this case Opera has 4 titles:
"Website Name - Opera", "Opera", "M", "Default IME". By the way last Title AutoIt also creates.
You've right, is no Bug, but it would be worth to know this background, so you can add this at the official help file, if you think is ok...?
Do you have any idea how many exceptions there could be potentially?
I cannot see ant reason why we should even try to document this as this is cearly your mistake and although I understand the mistake is easily made, its still up to the scripter to do debugging and proper design.
Again, use our forums the next time when things don't work.
Jos

New Ones:
Opt("WinTitleMatchMode",2) WinActivate("Opera") ;Title is "Schnellwahl - Opera"Its only deactivate the current windows)
But WinActive seems to work always correct