Opened 16 years ago

Closed 16 years ago

#179 closed Bug (Duplicate)

The use of "[CLASS:classnane; TEXT:controltext]" method to identify controls has been broken in the latest betas

Reported by: Bowmore Owned by:
Milestone: Component: AutoIt
Version: Other Severity:
Keywords: AutoIt beta Cc:


Win XP Home/Pro SP2
AutoIt beta

The use of "[CLASS:classnane; TEXT:controltext]" method to identify controls has been broken in the latest beta, I haven't checked 11.1 and 11.2, I is working correctly in

My investigations so far point to the sailient point being that if one of the controls in the CLASS: has a null text value "" then it seems to be selected in preference to the TEXT: value specified

Script to reproduce observed behaviour using Word 2002 or 2003.
Hopefully someone will have access to Word and be able to confirm my observations.

To used it you need to have a number of toolbars visible and docked including the 'Web' and 'Visual Basic' toolbars. Run with and and you'll see the difference. The 'Visual Basic' toolbar is found in but not in

;Requires Word 2002 or 2003 with most toolbars visible and docked 'WEB' and 'Visual Basic' must be visible. may work with
#Include <WinAPI.au3>
#Region ### Set Options
Opt("WinWaitDelay", 100)
Opt("WinTitleMatchMode", 4)
Opt("WinDetectHiddenText", 1)
Opt("MouseCoordMode", 2)
Opt("MustDeclareVars", 1)
#EndRegion ### Set Options

WinWait("[REGEXPTITLE:^.* - Microsoft Word$]","")
If Not WinActive("[REGEXPTITLE:^.* - Microsoft Word$]","") Then WinActivate("[REGEXPTITLE:^.* - Microsoft Word$]","")
WinWaitActive("[REGEXPTITLE:^.* - Microsoft Word$]","")

; remove the text from the 'Web' toolbar 
; so that there is a least one toolbar with "" text.
ControlSetText ("[REGEXPTITLE:^.* - Microsoft Word$]","","[CLASS:MsoCommandBar; TEXT:Web]", "" )

Global $hWnd = ControlGetHandle("[REGEXPTITLE:^.* - Microsoft Word$]","","[CLASS:MsoCommandBar; TEXT:Visual Basic]")
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hWnd = ' & $hWnd & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console

Global $Result = _WinAPI_GetWindowText($hWnd)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Result = ' & $Result & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console

Attachments (0)

Change History (2)

comment:1 Changed 16 years ago by TicketCleanup

  • Version set to Other

Automatic ticket cleanup.

comment:2 Changed 16 years ago by Valik

  • Resolution set to Duplicate
  • Status changed from new to closed

I know it doesn't sound like it, but this is actually a duplicate of #173. The bug is, the advanced title matching is only reading up to the first ; character. It should be fixed in Closing this as Duplicate, re-open if you experience the same behavior with when it's released.

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

as closed The ticket will remain with no owner.

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

Note: See TracTickets for help on using tickets.