Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Reading contents of other apps Window

Reading contents of other apps Window

Scheduled Pinned Locked Moved C / C++ / MFC
hardwarequestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hardy_Smith
    wrote on last edited by
    #1

    Hi all, I want to "control" an application with a second one. The app it there to control a Hardware and I don't have the code:(. It is command-based: I can write a command in a CEdit-like window, and the response is displayed in the same window. ( a Hexdump, maybe ) Is it possible to grap the contents of this window and to write ( from my own app ) into it? Somethink like enumerateWindow and then access over the clipboard? :confused: Thanks , Hardy.

    D 1 Reply Last reply
    0
    • H Hardy_Smith

      Hi all, I want to "control" an application with a second one. The app it there to control a Hardware and I don't have the code:(. It is command-based: I can write a command in a CEdit-like window, and the response is displayed in the same window. ( a Hexdump, maybe ) Is it possible to grap the contents of this window and to write ( from my own app ) into it? Somethink like enumerateWindow and then access over the clipboard? :confused: Thanks , Hardy.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      If you have a handle to the (edit) control, you can use GetWindowText() to get its contents.


      "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

      "There is no death, only a change of worlds." - Native American Proverb

      H 1 Reply Last reply
      0
      • D David Crow

        If you have a handle to the (edit) control, you can use GetWindowText() to get its contents.


        "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

        "There is no death, only a change of worlds." - Native American Proverb

        H Offline
        H Offline
        Hardy_Smith
        wrote on last edited by
        #3

        DavidCrow wrote:

        If you have a handle to the (edit) control, you can use GetWindowText() to get its contents.

        I think its not so simple. The Application ( A1 ) to control the Hardware is ready and closed. I am writing a new App ( A2 ) , in mfc, to do some extra-work. Now I want to access A1`s main window. I want to write to it and read from it from within A2. Thanks, Hardy.

        D 1 Reply Last reply
        0
        • H Hardy_Smith

          DavidCrow wrote:

          If you have a handle to the (edit) control, you can use GetWindowText() to get its contents.

          I think its not so simple. The Application ( A1 ) to control the Hardware is ready and closed. I am writing a new App ( A2 ) , in mfc, to do some extra-work. Now I want to access A1`s main window. I want to write to it and read from it from within A2. Thanks, Hardy.

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Hardy_Smith wrote:

          The Application ( A1 ) to control the Hardware is ready and closed...Now I want to access A1`s main window.

          How do you expect to read from a non-existent window?


          "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

          "There is no death, only a change of worlds." - Native American Proverb

          H 1 Reply Last reply
          0
          • D David Crow

            Hardy_Smith wrote:

            The Application ( A1 ) to control the Hardware is ready and closed...Now I want to access A1`s main window.

            How do you expect to read from a non-existent window?


            "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

            "There is no death, only a change of worlds." - Native American Proverb

            H Offline
            H Offline
            Hardy_Smith
            wrote on last edited by
            #5

            With closed I mean closed-source. I don't have the source. The window itselve is open, of course. Sorry, it was not clear.

            D 1 Reply Last reply
            0
            • H Hardy_Smith

              With closed I mean closed-source. I don't have the source. The window itselve is open, of course. Sorry, it was not clear.

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              Like I said before, get a handle to the (edit) control (using FindWindow()), then use GetWindowText() to get its contents.


              "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

              "There is no death, only a change of worlds." - Native American Proverb

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups