get the text from a window in an external program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beethoven
    New Member
    • Oct 2008
    • 3

    #1

    get the text from a window in an external program

    Hi

    Is it possible via C# to capture content of a window in a windows application?

    I have an application(mp3 player) with several windows and in one of them there are lines of text(names of the mp3 files). I want to to capture what filename is selected and activated(playe d).

    I have some hunch that it might be the process class I have to use, but how do I tell it what window to capture from and what filename is selected and activated?
  • joedeene
    Contributor
    • Jul 2008
    • 579

    #2
    Well if it's an application you created then I think there are ways you can create to communicate the information with each other, but if its just an external program, then I don't think it's possible.

    joedeene

    Comment

    • beethoven
      New Member
      • Oct 2008
      • 3

      #3
      It is a program that I haven't created and I don't have the source code.

      I know it is possible with a console application. But what about a windows application?

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        There exists some win32_API that can do that. You would need to check with the c++ folks for the details though

        Comment

        • joedeene
          Contributor
          • Jul 2008
          • 579

          #5
          Well, what's some of the code that you can do it for the console app, because a windows app's code is not much different from the console's...And I can help you translate it, if you are running into problems coding spefically any section...?

          joedeene

          Comment

          • beethoven
            New Member
            • Oct 2008
            • 3

            #6
            well, this article nicely shows how to capture output from a console program.

            http://www.codeproject .com/KB/cs/ProcessStartDem o.aspx

            But it doesn't work with a windows application. No output is done.

            Comment

            Working...