2 Console Questions

Started by
4 comments, last by Ned_K 14 years, 11 months ago
Hi, I have two simple console questions. 1. Can I get unicode support for apps running in console mode? 2. Can I add a background picture to a console (by hook or by crook) or would I need to write an emulator if I wanted that functionality? Thanks.
Advertisement
On what platform?
Sorry, windows. Xp and up.
Quote:Original post by Ned_K
1. Can I get unicode support for apps running in console mode?
Simplest will be to use WriteConsole instead of wprintf/wcout
Quote:2. Can I add a background picture to a console (by hook or by crook) or would I need to write an emulator if I wanted that functionality?
Doubt it but might work
Read/WriteConsoleW can read/write unicode chars to the console, but they won't display properly unless the console font contains the relevant glyph. I don't think the default font has support for anything outside the 255 chars of the current codepage and to compound the misery, you can't officially change it to Lucida Console programmatically as SetConsoleFont isn't documented. It is exported from kernel32 however, so you can GetProcAddress it providing you can find a valid declaration. Vista and above includes SetCurrentConsoleFontEx though which would seem to do the same.

As for the picture, as in a bmp/jpg, then no. Console windows are owned by csrss.exe so nearly all useful window related functions return access denied. Nothing stopping you from having an ASCII art background though :-)
Thanks for the replies.

This topic is closed to new replies.

Advertisement