Modify

Opened 13 years ago

Closed 13 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 by Jon, 13 years ago

Milestone: 3.3.9.11
Owner: set to Jon
Resolution: Fixed
Status: newclosed

Fixed by revision [8072] in version: 3.3.9.11

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


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