DOS screen output 'containment'

This is a discussion on DOS screen output 'containment' within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I am creating an operating environment to run over DOS - There is a command prompt - type interface to ...

  1. #1
    Registered User Unimatrix139's Avatar
    Join Date
    Jun 2002
    Posts
    55

    Question DOS screen output 'containment'

    I am creating an operating environment to run over DOS - There is a command prompt - type interface to the left and a simplistic GUI to the right. I have adapted the command-prompt interface to keep to it's own space and now overwrite the GUI but if a DOS application is executed from within the OE the GUI is overwritten. Is there some way of intercepting the data written to the screen by DOS and display it with my own code?
    Kree'ta Tau'ri! Chaapa'ai!

  2. #2
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    i'm not exactly sure on what to do, but as a start i'd look into echo (dos command) perhaps if you send the system command "echo" it will echo it in your program....just a thojught
    PHP and XML
    Let's talk about SAX

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    46
    Ive always been interested in that as well, The only thing I know is that when you execute a program I think you can redirect its ouput to a files using >> after you execute it.

    MyProgram.exe >> output.txt

  4. #4
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    oh man i can't beleive i forgot about those!!!

    whenever you issue a dos command from your front program, issue it like this (in dir's case) dir>>whatever.txt
    then read that in with your program. But that could be slow....so perhaps you can redirect it to your program in the same manner?
    dir>>GUI.exe ?
    PHP and XML
    Let's talk about SAX

  5. #5
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>Is there some way of intercepting the data written to the screen by DOS
    Can you give us an idea on what and how you invoked to get DOS to write something.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  6. #6
    Registered User Unimatrix139's Avatar
    Join Date
    Jun 2002
    Posts
    55
    I was going to use system() to actually call the command and find a way to specify boundaries for the data written to the screen by DOS, but the file method seems better. I'll try that. Thanks!
    Kree'ta Tau'ri! Chaapa'ai!

  7. #7
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    a suggestion:

    add functionality to your program so that it may work as a text editor. In this way you can constantly have the file open, and constantly allow it to be updated by an outside source. (MFC uses the document/view arch but i would stay away from that approach). This way you can save time by having the document loaded (or in ease of reloading) and ready to read whenever it updates....
    hell in that case you could even have a seperate program watching for it to update and sending your prog data....not sure how that will effect speed.
    PHP and XML
    Let's talk about SAX

  8. #8
    Registered User
    Join Date
    Nov 2002
    Posts
    46
    *Quote*
    hell in that case you could even have a seperate program watching for it to update and sending your prog data....not sure how that will effect speed.

    that wouldnt work, dos cant multitask.

  9. #9
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    yes that's true, but, there are ways you can do a sort of simulated multi task. I'm not sure how, but there's been talk of it being done in these boards before.

    Mostly I just wasn't thinking about it being DOS, i just thought it was a GUI to it from windows.
    PHP and XML
    Let's talk about SAX

  10. #10
    Registered User
    Join Date
    Dec 2002
    Posts
    32

    i asked a similar question before

    And i got a good answer
    check it out
    Capturing system commands

  11. #11
    Registered User Unimatrix139's Avatar
    Join Date
    Jun 2002
    Posts
    55

    Wow!

    Thanks manwhoonlyeats - thats exactly what I was looking for!
    Kree'ta Tau'ri! Chaapa'ai!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Feedback: Functional Specification Wording
    By Ragsdale85 in forum C++ Programming
    Replies: 0
    Last Post: 01-18-2006, 03:56 PM
  2. Capturing dos text screen in C
    By hednast in forum C Programming
    Replies: 13
    Last Post: 08-11-2005, 07:49 PM
  3. Taking Screenshot - Full Screen Dos
    By loko in forum C Programming
    Replies: 12
    Last Post: 07-16-2005, 01:23 AM
  4. Flash display in DOS screen
    By lordkrishna in forum C++ Programming
    Replies: 9
    Last Post: 02-23-2004, 02:10 AM
  5. Output to screen display issues
    By spazjr01 in forum C++ Programming
    Replies: 3
    Last Post: 12-16-2002, 04:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21