Windows Messages

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matt. Davies

    Windows Messages

    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
    matt@starskill. com
  • Tom Shelton

    #2
    Re: Windows Messages

    In article <f2c61626.04092 10738.db02e0c@p osting.google.c om>, Matt. Davies wrote:[color=blue]
    > 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 :
    >[/color]

    You'll need some various api calls..[color=blue]
    > 1) Find the window somehow[/color]

    FindWindow or FindWindowEx
    [color=blue]
    > 2) Find the textbox/combobox/listbox somehow[/color]

    FindWindowEx or EnumChildWindow s (findwindowex is easier :)
    [color=blue]
    > 3) read the messages being received and sent from it
    > 4) retrieve the ones I want and ....Bob's your Aunties live in lover..
    >[/color]

    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.

    --
    Tom Shelton [MVP]

    Comment

    Working...