I was just wondering if anyone knew how to run two linked output windows at the same time or if it is even possible. I'd appreciate any and all help. Thanks!!! ^_^

What do you mean by "output window"?

If you mean some TTY (like the console) then the answer is: yes, it is possible.
If you mean some other thing then the answer is: maybe.

Either way, you're going to have to be dinking around with things in an OS-specific way.

A better question is why on earth you want to duplicate your output to multiple <something>s?

(BTW. If you are using Unix or Linux, type "man tee".)

I'm using Dev-C++ and my OS is Windows Vista. The output for my programs comes up in a single Cprompt window. What I would like to know is if there is any way to have two or more Cprompt windows to be displayed and linked with eachother.

This is basically what I mean:

Window One: (prompts for age)
(user inputs a number and hits enter)
Window Two: (displays "Your age is" what ever the user types into Window One)

This is probably really confusing to you, because its confusing to me as well. Basically I would like to know if there is any way that I can run one program that creates to Cprompt windows that will run simultaniously and be able to share data with eachother. Any help or advice would be VERY useful.

You've explained yourself very clearly.

In Windows, an application is only permitted to have one "console" attached at any given time. There are tricky ways around this, but those ways involve far more than you are ready to handle... besides which, it is a weird thing you want to do. (Though, admittedly, cool.)

You could "fake it" by having your application put up a Windows multi-line edit control for the output window. You can change the font and colors to match the console. This is as close to the same thing as you can easily get.

Do you have Win32 documentation? (You'll need it for this!)


Keep in mind that console processes aren't supposed to be aware of "windows" and "console windows" and the like. They are only supposed to understand input and output streams. How the streams are associated with the program is supposed to be entirely up to the person using the program. What I am saying is that you are trying to write a Windows application that just happens to use the Windows Console.

Hope this makes sense, and helps.

Thanks, and it mostly does make sense to me, but I've only been programming for a year and a half so it's not all completely clear. The actual application I was hoping to use to console windows for was so that when you were playing a text RPG that I made you would also be able to see your stats, weapons, time, etc. But I guess I'm going to have to find a way around using two windows. Thanks for all your help!!! ^_^

This article has been dead for over six months. Start a new discussion instead.