Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#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 Changed 10 years ago by xelotiac@…

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 Changed 10 years ago by xelotiac@…

To sum up all:

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

comment:3 Changed 10 years ago by Jos

  • Resolution set to No Bug
  • Status changed from new to 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 Changed 10 years ago by anonymous

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 follow-up: Changed 10 years ago by 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...?

comment:6 in reply to: ↑ 5 Changed 10 years ago by Jos

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 Changed 10 years ago by xelotiac@…

Well, I think you've right.

Thanks!

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.