Modify

Opened 17 years ago

Closed 17 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 3.2.11.3 Cc:

Description

Win XP Home/Pro SP2
AutoIt beta 3.2.11.3

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

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 3.2.10.0 and 3.2.11.3 and you'll see the difference. The 'Visual Basic' toolbar is found in 3.2.10.0 but not in 3.2.11.3

;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 17 years ago by TicketCleanup

  • Version set to Other

Automatic ticket cleanup.

comment:2 Changed 17 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 3.2.11.4. Closing this as Duplicate, re-open if you experience the same behavior with 3.2.11.4 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

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.