geriatrix
asked on
How do I redirect console output from cmd.exe for full-screen console apps
How do I redirect console output from cmd.exe for full-screen console apps, e.g. telnet, edit, etc. I wish to gain access to application input & output.
I'm assuming that either the program (e.g. telnet) or the shell (e.g. cmd.exe) is making calls to the windows console functions, e.g. ReadConsoleOutput, WriteConsoleInput, etc. These functions fail when the STDIN, STDOUT and STDERR streams have been redirected. Does anyone know of code to get and redirect the info? Is it a matter of hooking all the console functions in user32.dll or kernel32.dll?
Thanks for any info.
I'm assuming that either the program (e.g. telnet) or the shell (e.g. cmd.exe) is making calls to the windows console functions, e.g. ReadConsoleOutput, WriteConsoleInput, etc. These functions fail when the STDIN, STDOUT and STDERR streams have been redirected. Does anyone know of code to get and redirect the info? Is it a matter of hooking all the console functions in user32.dll or kernel32.dll?
Thanks for any info.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I showed a link with a solution. This particular question is quite hard to solve, but on the locations of these links is enough information, including full solutions. I don't think this question should be deleted (I already had it in my KB for that matter...)
ASKER