I need to open a Console window from the application and need to perform read write operation using console API.
-
what programming language and/or framework you are developing with?Sarwar Erfan– Sarwar Erfan2011-02-17 06:46:49 +00:00Commented Feb 17, 2011 at 6:46
-
What kind of program do you have now? Do you want to start a console from a GUI application?Cody Gray– Cody Gray ♦2011-02-17 06:52:09 +00:00Commented Feb 17, 2011 at 6: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– Johnnie2011-02-17 08:05:35 +00:00Commented Feb 17, 2011 at 8:05
2 Answers
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
Comments
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 :)