-
Windows console problems
Hi,
I've been experimenting a bit with the Windows Console and with a bit of searching I can now set text colour and position the cursor anywhere on the screen to write text, get keyboard input (including arrow keys)... that's easy.
But I have two main problems:
1) I'm using a FOR loop to fill the entire screen with a certain colour and have a border. I use charactors at the edges of the screen to make a border. However, it is very slow - you can see it drawing each charactor across the screen. It takes a second or two. Can this be made faster?
I tried using cout to write entire strings at a time, but subsequent gotoxy() functions wouldn't change the position at all. I'm using the gotoxy() function in the FAQ.
2) Minor problem, but writing a charactor in to the very bottom-right co-ordinate scrolls the screen down a line. I can leave it out, but it doesn't look too nice with a small black gap in the corner of the border. Can I prevent the console scrolling down?
Using: Microsoft Visual C++ 6.0 on Windows 98.
Someone will probably say something along the lines of 'Just make a win32 application', but I've tried experimenting and looking up some information and had little success. Is there anywhere I can get hold of some decent tutorials for a windows application? Setting pixels, writing a string, getting keyboard input, that sort of thing?
Thanks for your patience.
-
I've moved the thread to "Windows specific" because, well, it is.
The answer to both of your problems is yes, it can be done better and faster, but, if you want to do this in a window rather than a console, there is little point getting into the details. So, do you want the console story, (manipulating the console buffers), or do you want us to try and teach you how to use a window?
The console stuff is not that difficult, but is ultimately limited. The Windows is more complicated, and you'll need to program in a slightly different way, but once you've got it, the entire GUI is open to you.
The console thing we can sort out in a few days, the Window WILL take longer.
You're choice.
I think The Forgers tutorial here is pretty good if you want to look at something while you make up your mind!
-
Don't worry, I think I may as well just move on to Win32 API because consoles are ugly and limited...
So I'll have a good read of that tutorial and ask some more specific questions later if necessary.
Thanks.