Modify

Opened 5 years ago

Closed 5 years ago

#2362 closed Bug (Fixed)

ControlGetText, WinGetTitle sometimes reads ANSI as Wide

Reported by: Ascend4nt@… Owned by: Jon
Milestone: 3.3.9.11 Component: AutoIt
Version: 3.3.9.10 Severity: None
Keywords: Cc:

Description

Sometimes ControlGetText or WinGetTitle will return characters that display as a mess of '?'s (in Console output). This is because of an issue with SendMessage with WM_GETTEXT. Windows will sometimes return ANSI strings, and return the # of bytes rather than characters. AutoIt internally assumes this is Unicode and treats it as such - so it displays incorrectly.

To overcome this problem, zero out a buffer, fill it with WM_GETTEXT, then do a simple wcslen() on the return to compare it to the length that WM_GETTEXT returns. It should be roughly half the size if it is an ANSI string (you need to take into account odd # returns here).

I wrote script code that works around this problem, see:
www.autoitscript.com/forum/topic/148411-fix-for-unreadable-text-from-wingettext-controlgettext/

Attachments (0)

Change History (1)

comment:1 Changed 5 years ago by Jon

  • Milestone set to 3.3.9.11
  • Owner set to Jon
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [8072] in version: 3.3.9.11

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 owner will remain Jon.
Author


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

 
Note: See TracTickets for help on using tickets.