Jump to content

TTntListBox.UnicodeClass1 Problem


jonny1234
 Share

Recommended Posts

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

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...