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. Capture input of the CommandWindow

Capture input of the CommandWindow

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
2 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.
  • A Offline
    A Offline
    Adi Narayana
    wrote on last edited by
    #1

    How to capture the status that's getting displayed in command window(local system only) from another windows application..... any ideas???? thanks in advance adi

    J 1 Reply Last reply
    0
    • A Adi Narayana

      How to capture the status that's getting displayed in command window(local system only) from another windows application..... any ideas???? thanks in advance adi

      J Offline
      J Offline
      JoeZhang
      wrote on last edited by
      #2

      Make the output text of that console app into a disk file instead of printing to the command window, and then read the contents of the file into a memory buffer and parse that buffer for your needs... But how to do this in your program? here's a solution: Dynamically generate a .BAT batch file in your program, the contents of this batch file is like this: consoleApp.exe >> c:\output.txt Here, consoleApp.exe is the filename of that console app you want to capture its output, and then launch this batch file via CreateProcess win32 API. After the end of console app, what its outputs are placed into the output.txt file... Hope this helps.:laugh:

      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