Well, I have a simple question, at least I hope it is simple. For some time I was interested in the win32 console. Our teacher told us that the Windows console is for DOS and real-mode emulation only. Well, I know this is not true because DOS applications are launched by an emulator that uses the console to output the output. Another thing I found out is that the console is built into Windows with NT. Well. But I could not find how actually console programs written to use the console. I use Visual C ++ for programming (well, for learning). So, the only thing I need to do to use the console is to select a console project. At first, I thought that Windows was deciding whether to launch the application in the console or trying to start the application in window mode. So I created a win32 program and tried printf (). Well, I could not compile it. I know that by definition printf () prints text or variables in stdout. I also found that stdout is a console interface for output. But I could not find what actually is.
So, basically, what I want to ask is where is the difference between a console application and a win32 application. I thought that windows start the console when it receives a command from the console-family functions. But apparently this does not happen, so there should be some code that actually manages the windows to create the console interface.
And the second question: when the console is created, how does Windows recognize which console terminal is used for any application? I mean, what is it really stdout? Is this a memory area or some kind of window procedure called? Thank you
source share