I need to open a Console window from the application and need to perform read write operation using console API.
Asked
Active
Viewed 1,727 times
2
-
what programming language and/or framework you are developing with? – Sarwar Erfan Feb 17 '11 at 06:46
-
What kind of program do you have now? Do you want to start a console from a GUI application? – Cody Gray - on strike Feb 17 '11 at 06:52
-
I am using C programming language.. Currently porint some appli from Linux to windows. In Linux I have used ptmx and Xterm for Writing and Reading from the terminal, I not sure how can it be done in windows. Basiclly I want a Console to read the data provided by user and pass it on to the application and write data to user returned by applic. This console has to be like a child to the main Application. – Johnnie Feb 17 '11 at 08:05
2 Answers
2
To work with consoles in WinAPI there are some functions such as AllocConsole(), GetStdHandle(), WriteConsole(), ReadConsole(), etc. More info at http://msdn.microsoft.com/en-us/library/ms682073(VS.85).aspx

Eugene Burtsev
- 1,465
- 4
- 24
- 45
0
First case in my mind is to create two levels of your application: server and clients. Server will start clients(new console windows) and clients will cooperate with server. How it would be done you must choose(crossproccess interaction, sockets, etc.)
Second case is intercepting of WinAPI messages from other console window, but in that case i can`t help you :)

Sergey Vedernikov
- 7,609
- 2
- 25
- 27
-
Why do you assume it's a client-server application? And how in the world would one intercept Win API messages from another console window? Are you talking about [WinEvents](http://msdn.microsoft.com/en-us/library/ms682102.aspx)? – Cody Gray - on strike Feb 17 '11 at 06:54
-
yes, WinEvents. It`s may not necessarily be client-server, just what i can imagine for your task. – Sergey Vedernikov Feb 17 '11 at 07:01