Archived

This topic is now archived and is closed to further replies.

mixing console and win32

This topic is 5015 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there an easy way to mix the two. Basically I have an MFC app. I know want a sonsole box to pop up do a couple of cout operations and then close again when I press a key. After closing the app continues as normal. Basically: normal code... Open console cout<<"somethin"; getch(); wait for key press Close Console continue normal code... Is there an easy way to do this? -CProgrammer

Share this post


Link to post
Share on other sites
Look into these functions:


AllocConsole
CreateConsoleScreenBuffer
FillConsoleOutputAttribute
FillConsoleOutputCharacter
FlushConsoleInputBuffer
FreeConsole
GenerateConsoleCtrlEvent
GetConsoleCP
GetConsoleCursorInfo
GetConsoleMode
GetConsoleOutputCP
GetConsoleScreenBufferInfo
GetConsoleTitle
GetLargestConsoleWindowSize
GetNumberOfConsoleInputEvents
GetNumberOfConsoleMouseButtons
GetStdHandle
HandlerRoutine
PeekConsoleInput
ReadConsole
ReadConsoleInput
ReadConsoleOutput
ReadConsoleOutputAttribute
ReadConsoleOutputCharacter
ScrollConsoleScreenBuffer
SetConsoleActiveScreenBuffer
SetConsoleCP
SetConsoleCtrlHandler
SetConsoleCursorInfo
SetConsoleCursorPosition
SetConsoleMode
SetConsoleOutputCP
SetConsoleScreenBufferSize
SetConsoleTextAttribute
SetConsoleTitle
SetConsoleWindowInfo
SetStdHandle
WriteConsole
WriteConsoleInput
WriteConsoleOutput
WriteConsoleOutputAttribute
WriteConsoleOutputCharacter

I'm sorry I can't go through in detail, but basically AllocConsole creates a console, FreeConsole destroys it, and everything else messes with it.

P.S. Be aware that it doesn't really work like a normal console.

[edited by - Promit on March 20, 2004 11:03:42 PM]

Share this post


Link to post
Share on other sites