Qbasicnews.com

Full Version: windows console apps
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
is there a way to get the buffer address of a console under windows? i want to write chars directly to the screen buffer. i thought i'd try 0xb800 or 0xvb8000, maybe windows maps those to the buffer (as it does with dos console apps)... but no.



so help!!!

anyone?



[Flexibal>
I think you can't. Console apps are restricted as they are protected mode windows applications. That means that you can't access directly the system features, you have to use the services that windows (the OS) gives to you.

So I think that outta printf/scanf or cin/cout you won't get any further. Anyhow, you can try and learn about API calls for console programming. They provide a lower level interface, but nothing similar to direct b800h writings Sad
yes, i used WriteConsole etc. for a while... but i just wanted to get direct access to the console screen buffer, without having to get the STDOUT handle. oh well. it's hightly stupid, if you ask me, to treat the console like a file. what's the point? files and screens are fundamentally different. so wow, if you'd do:

myprog >myfile.txt

it will make myfile.txt STDOUT and then data will be written to the file and not to the screen. but since in windows at least, a process can have no more than one console -- STDIN, OUT and ERR are basically the same.



sigh





[Flexibal>
Yeah, that's the bad thing about consoles. AFAIK and IMHO, console programming is just intended for easy and simple interfacing tasks, as they come from the ol' days of those typewriter terminals (no screens).

Micro$ux just wanted to add *nix-alike features to its OS, so they adopted the *nix console. And the *nix console comes from those ol'days.

Screen being treated as a file is because of that: in the past, there was no screen but a simple typewriter.

If you need better aesthetics I'd suggest you to forget about console. Or make a DOS program, if you don't add many whistles you'll have direct access to the text screen Wink
okay. i'll see if directx can do that... or i could emulate a console using directx. i know direct input can hook your keyboard, etc., so perhaps i can lock the screen as well.





[Flexibal>