Windows Messages

M

Matt. Davies

How do I retrieve text from a combobox within an application running
on my system using Windows Messages?

I have a third party application with a text box that is constantly
being updated from the internet. I want to retrieve that text into my
app and filter it.

I have been playing around with Spy++...but I need to have that
'Eureka' moment when I get how to use the information it supplies.

My guess so far :

1) Find the window somehow
2) Find the textbox/combobox/listbox somehow
3) read the messages being received and sent from it
4) retrieve the ones I want and ....Bob's your Aunties live in lover..

I can manually find the window and control in Spy++, and I can see the
messages with my eyes, but not with my app.

Any help, even if it's...go buy a book you moron...would be
appreciated.

Matt. Davies
(e-mail address removed)
 
T

Tom Shelton

How do I retrieve text from a combobox within an application running
on my system using Windows Messages?

I have a third party application with a text box that is constantly
being updated from the internet. I want to retrieve that text into my
app and filter it.

I have been playing around with Spy++...but I need to have that
'Eureka' moment when I get how to use the information it supplies.

My guess so far :

You'll need some various api calls..
1) Find the window somehow

FindWindow or FindWindowEx
2) Find the textbox/combobox/listbox somehow

FindWindowEx or EnumChildWindows (findwindowex is easier :)
3) read the messages being received and sent from it
4) retrieve the ones I want and ....Bob's your Aunties live in lover..

This part is going to be difficult if your saying you want those
messages as the are sent to the other application. With that, your
entering an area that is not possible to do with .NET alone. That is
something called a cross process message hook - and you have to put that
hook function into a native dll. That means you need to use something
like C/C++/PowerBasic/Pascal etc... Basically, you need to use a
language that is capable of creating a dll that exports entry points.
You can then use P/Invoke to hook into this dll.

You could use a timer and poll the text box that you want with
SendMessage and a WM_GETTEXT message - but, getting the frequency right
may be an issue if the text changes rapidly.
 

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