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. command line application - get text

command line application - get text

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 Posts 2 Posters 1 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.
  • M Offline
    M Offline
    micutzu
    wrote on last edited by
    #1

    Hello, I have a command line application – developed by someone else and I need to be able to get the text from it (at some point that application writes in the command line window that a task is completed and I need to know when that occurs). I am able to find the window by the GetWindowText returns me the window name – which I already use for finding the window and the ::SendMessage(hwnd,EM_SETSEL,0,-1); //start selecting ::SendMessage(hwnd,WM_COPY,0,0); ::SendMessage(hwnd,EM_SETSEL,-1,0); //end selecting if (!IsClipboardFormatAvailable(CF_TEXT)) return TRUE; if (! ::OpenClipboard(NULL)) return TRUE; hglb = GetClipboardData(CF_TEXT); is not working. If anyone knows a way to solve this problem – please let me know. Thanks.

    N 1 Reply Last reply
    0
    • M micutzu

      Hello, I have a command line application – developed by someone else and I need to be able to get the text from it (at some point that application writes in the command line window that a task is completed and I need to know when that occurs). I am able to find the window by the GetWindowText returns me the window name – which I already use for finding the window and the ::SendMessage(hwnd,EM_SETSEL,0,-1); //start selecting ::SendMessage(hwnd,WM_COPY,0,0); ::SendMessage(hwnd,EM_SETSEL,-1,0); //end selecting if (!IsClipboardFormatAvailable(CF_TEXT)) return TRUE; if (! ::OpenClipboard(NULL)) return TRUE; hglb = GetClipboardData(CF_TEXT); is not working. If anyone knows a way to solve this problem – please let me know. Thanks.

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      Is this article of any use http://www.codeproject.com/useritems/ConsoleAdapter.asp[^]

      nave

      M 1 Reply Last reply
      0
      • N Naveen

        Is this article of any use http://www.codeproject.com/useritems/ConsoleAdapter.asp[^]

        nave

        M Offline
        M Offline
        micutzu
        wrote on last edited by
        #3

        Thank you. I had just try the sample and it seems to work :). Thanks!

        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