It won't matter what you do with the console. Windows printers don't work that way.
(Well, your printer might be able to receive a text stream with special color and other markup codes... but you have to know your printer pretty well to do that.)
To do stuff on the printer, render your text to a properly-initialized printer device context and then draw to the GDC.
Google "msdn printer device contexts" for the overview.
You'll need to use the following API functions:
GetPrinter() - get a handle to the default printer
CreateDC() - open a GDC for that printer
StartDoc() - start a new job
StartPage() - start a new page
SetMapMode() - (do some reading about the kinds of things you can adjust)
CreateFont() - create a font to use
SelectObject() - select the font and pen to use
TextOut() - write text with the font
EndPage() - signal end of page
EndDoc() - signal end of job
DeleteDC() - done with printer DC (force print)
You change colors by selecting a
pen to use.
1 2
|
SelectObject( hdc, GetStockObject( DC_PEN ) ); // Select a pen into the DC
SetDCPenColor( RGB( 255, 0, 0 ) ); // Set the pen's color to RED
|
I know it looks like a lot, but it isn't really, especially considering that you are drawing a picture and sending it to the printer.
Hope this helps.