Jump to content
Sign in to follow this  

_GUICtrlListBox_GetText returns garbage from Java Applets

Recommended Posts


When I use _GUICtrlListBox_GetText to get the text of items in a Java applet list box, the text returned is not as it is displayed in the listbox. It is somehow corrupted or encoded in some other form other than ordinary text.

An example is this webpage:


The following code produces "@©°", rather than the text "My Kingdom" from the listbox:

#include <IE.au3>
#Include <GuiListBox.au3>
$oIE = _IECreate ("http://www.somacon.com/p51.php")
$java_hwnd = WinGetHandle("Java Auto-Completing Combobox Applet - Windows Internet Explorer")
$cntl_hwnd = ControlGetHandle($java_hwnd, "", "[CLASS:ListBox; INSTANCE:1]")
ConsoleWrite(_GUICtrlListBox_GetText($cntl_hwnd, 1))

Is there some way I can get the actual text from the listbox, or even convert/decode this garbage text into something that resembles the actual text?

"_GUICtrlListBox_GetCount" returns 1956, which is correct, so I believe the GuiListBox Management UDFs are recognising this control. Other functions like "_GUICtrlListBox_SetSel" also work.

Also note that JavaFerret (as part of the Java Access Bridge) cannot retrieve any text from Java listboxes in applets such as this one. I suspect there may be no way of getting this text, both inside and out of AutoIT.

Edited by seangriffin

Cheers, Sean.

See my other UDFs:

Chrome UDF - Automate Chrome | SAP UDF - Automate SAP | Java UDF - Automate Java Applications & Applets | Tesseract (OCR) UDF - Capture text from applications, controls and the desktop | Textract (OCR) UDF - Capture text from applications and controls | FileSystemMonitor UDF - File, Folder, Drive and Shell Monitoring | VLC (Media Player) UDF - Creating and controlling a VLC control in AutoIT | Google Maps UDF - Creating and controlling Google Maps (inc. GE) in AutoIT | SAPIListBox (Speech Recognition) UDF - Speech Recognition via the Microsoft Speech (SAPI) ListBox | eBay UDF - Automate eBay using the eBay API | ChildProc (Parallel Processing) UDF - Parallel processing functions for AutoIT | HyperCam (Screen Recording) UDF - Automate the HyperCam screen recorder | Twitter UDF - Automate Twitter using OAuth and the Twitter API | cURL UDF - a UDF for transferring data with URL syntax

See my other Tools:

Rapid Menu Writer - Add menus to DVDs in seconds | TV Player - Automates the process of playing videos on an external TV / Monitor | Rapid Video Converter - A tool for resizing and reformatting videos | [topic130531]Rapid DVD Creator - Convert videos to DVD fast and for free | ZapPF - A tool for killing processes and recycling files | Sean's eBay Bargain Hunter - Find last minute bargains in eBay using AutoIT | Sean's GUI Inspector - A scripting tool for querying GUIs | TransLink Journey Planner with maps - Incorporating Google Maps into an Australian Journey Planner | Automate Qt and QWidgets | Brisbane City Council Event Viewer - See what's going on in Brisbane, Australia

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this