Window and Control Handles

M

Martin Priebe

Hello,

i use EnumWindows, GetWindowText, GetClassName and GetComboBoxInfo to get
informations about controls of a window.

i have a combobox and the handle of it.
then i have the listbox and the edit handle of the combobox.

how can i read out the text of the combobox or listbox.

i tried to use the sendmessage function with "LB_GetText"
but it didn´t works.

And I want to Set the Text ! - or set a item of the listbox.


i need help !

greetings
Martin
 
M

Mattias Sjögren

i tried to use the sendmessage function with "LB_GetText"
but it didn´t works.

It's ard to say why it doesn't work when you don't include your code.

To get or change the text of the edit control, WM_GETTEXT / WM_SETTEXT
should work.


Mattias
 
N

Nicholas Paldino [.NET/C# MVP]

Martin,

Have you tried the WM_GETTEXT and WM_SETTEXT windows messages? Also, I
seem to remember that with the combobox, you have to get the handle of the
edit control (textbox) that the combobox hosts.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top