Sign in to follow this  
Followers 0
jonny1234

TTntListBox.UnicodeClass1 Problem

6 posts in this topic

Hi,

I am trying to retrieve the items from a list control whose ClassNameNN is "TTntListBox.UnicodeClass1". I believe it is a Delphi control.

So far, I can get the number of items in the list using:

#include <GuiList.au3>

$window_handle = WinGetHandle($window_title)

$message_list_handle = ControlGetHandle($window_handle, "", $control_id_message_list)

$num_messages = _GUICtrlListCount($message_list_handle)

And I can select, for example, the first item in the list by using:

_GUICtrlListSetSel($message_list_handle, 1, 0)

But I can't get the text of the first item in the list. I have tried:

$message_text = _GUICtrlListGetText($message_list_handle, 0)

which just sets $message_text to 0 instead of setting it to the item text.

I also tried just getting the length of the text of the first item, by using:

$message_length = _GUICtrlListGetTextLen($message_list_handle, 0)

which returned the value 1. But the text is much longer than 1 character.

Please can you help.

Thanks,

Jonny

Share this post


Link to post
Share on other sites



I ain't gonna bump no more wit no big fat wooooo-man.

But if anyone can help me with this TTntListBox problem, I'd really appreciate it. It seems strange that I can get the item count and can select items, but can't get the item text.

Regards,

Jonny

Share this post


Link to post
Share on other sites

Thanks for the reply Zedna.

I have read your posts, but I can't figure out how to apply your solution to my problem. I compiled your DLL but couldn't get the example scripts to use it, so I'm just going to leave it. Thanks anyway.

When things start to become as complicated as this, I usually just look for a simpler approach (even if it is less elegant), which is what I am doing at the moment.

Regards,

Jonny

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Note: that DLL is not mine it's from tweast.

For get text from controls included in other process you need some more complicated API calls.

AutoIt has ControlListview() - for standard ListView control

That DLL (AutoitTreeViewExtension.dll) fills hole for missing ControlTreeView() in AutoIt - for standard TreeView control

So I think you need some similar solution - for standard ListBox control

EDIT:

for ListBox control you can use AutoIt's ControlCommand() & GetCurrentSelection - also for interprocess

Edited by Zedna

Share this post


Link to post
Share on other sites

It appears to be a problem relating to Unicode strings.

There are also two edit controls in the same application, one has ClassNameNN equal to "TEdit1" and the other is "TTntEdit.UnicodeClass1". I can retrieve the text of the first one, but not the second one which is a Unicode-aware control.

It would seem that AutoIt cannot read the Unicode string.

Can AutoIt read the text from Unicode controls?

Regards,

Jonny

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  
Followers 0