I went over to Win32 API when I had messed with console for about 5 days.
I really don't understand, why people mess with console anyway...
Printable View
I went over to Win32 API when I had messed with console for about 5 days.
I really don't understand, why people mess with console anyway...
many applications do not need a gui. Most of the valuable stuff on unix/linux is command line utilities/servers. Additionally, console is a pretty good place to stay while learning C++ because you don't get bogged down in learning something as complex as the Win32 API while you should be concentrating on the language.
Win32 API is simple... extremely simple...
On the original question -- you can get a handle to the console window using the API function GetConsoleWindow(). However, you can't (easily) receive window messages so it's of only limited use if you want to learn event-driven programming.
You can get resize events with ReadConsoleInput (the mode, set with SetConsoleMode, has to be correct). Some other interesting events can be obtained with SetConsoleCtrlHandler.
However, the console programs should typically be limited to programs that take a command line and output text. Anything more complicated typically requires a custom GUI.