KpyM Telnet/SSH Server - Forum
Me again - and WriteConsole etc.
Jan Me again - and WriteConsole etc.

I know how to write a very simple telnet server, but I would like to implement the feature that you can start and use remotely. It has something to do with the "video memory"...

Can you give me a hint ? What do I have to do to make it work? Or how can i redirect all the output to the socket, even's.

Thx for answers..

Kroum Grigorov
Playing with '' apps is little tricky
Actualy there are 2 problems
1) Sending input
2) Reading output

1) On how to send input to extermnal app, you can check my blog post "sending keyboard input to external application".

2) Reading console; writes output directly to "console memory", that's why you can't get its output using std handles. Instead you have to use the following "algorithm"

- You create the console process so that it uses the same console as the "telnet server" process using CreateProcess.
- Now get the std out handle of your "telnet server" process by calling GetStdHandle. The handle you get can be used to read output of "" process too, because the two processes share the same console (remember the previous point)
- Having the output handle just use "low level" console function as ReadConsoleOutput.


© 2007 - 2008 Kroum Grigorov
Powered by phpBB © 2001, 2005 phpBB Group