Modify

#909 closed Bug (No Bug)

WinActivate / WinExists / WinTitleMatchMode Title Bug

Reported by: xelotiac@… 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 xelotiac@…, on Apr 17, 2009 at 9:24:54 AM

New Ones:

Opt("WinTitleMatchMode",2)
WinActivate("Opera") ;Title is "Schnellwahl - Opera"

Its only deactivate the current windows)

But WinActive seems to work always correct

comment:2 by xelotiac@…, on Apr 17, 2009 at 9:28:38 AM

To sum up all:

. WinActivate works not very truly
. WinExists always checks the whole title

comment:3 by Jos, on Apr 17, 2009 at 12:00:31 PM

Resolution: No Bug
Status: newclosed

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 anonymous, on Apr 17, 2009 at 3:12:41 PM

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...

comment:5 by xelotiac@…, on Apr 17, 2009 at 4:04:04 PM

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...?

in reply to:  5 comment:6 by Jos, on Apr 17, 2009 at 10:42:16 PM

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

comment:7 by xelotiac@…, on Apr 20, 2009 at 7:20:59 PM

Well, I think you've right.

Thanks!

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.