Change default Console I/O functions handle.

Posted by b-gen-jack-o-neill on Stack Overflow See other posts from Stack Overflow or by b-gen-jack-o-neill
Published on 2010-05-12T19:38:50Z Indexed on 2010/05/12 21:34 UTC
Read the original article Hit count: 216

Filed under:
|
|
|
|

Hello. Is it possible to somehow change standart I/O functions handle on Windows? Language preffered is C++. If I understand it right, by selecting console project, compiler just pre-allocate console for you, and operates all standart I/O functions to work with its handle. So, what I want to do is to let one Console app actually write into another app Console buffer. I though that I could get first´s Console handle, than pass it to second app by a file (I don´t know much about interprocess comunication, and this seems easy) and than somehow use for example prinf with the first app handle. Can this be done? I know how to get console handle, but I have no idea how to redirect printf to that handle. Its just study-purpose project to more understand of OS work behind this. I am interested in how printf knows what Console it is assiciated with.

© Stack Overflow or respective owner

Related posts about handle

Related posts about console