PDA

View Full Version : DOS screen output 'containment'



Unimatrix139
11-23-2002, 12:56 PM
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?

Waldo2k2
12-02-2002, 06:53 PM
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

thedumbmutt
12-03-2002, 02:15 PM
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

Waldo2k2
12-03-2002, 04:11 PM
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 ?

Hammer
12-03-2002, 06:24 PM
>>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.

Unimatrix139
12-05-2002, 01:52 AM
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!

Waldo2k2
12-05-2002, 07:02 AM
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.

thedumbmutt
12-05-2002, 01:49 PM
*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.

Waldo2k2
12-05-2002, 08:37 PM
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.

manwhoonlyeats
12-18-2002, 07:40 PM
And i got a good answer
check it out
http://cboard.cprogramming.com/showthread.php?s=&threadid=30234

Unimatrix139
12-19-2002, 04:08 AM
Thanks manwhoonlyeats - thats exactly what I was looking for!