Thread: Windows console problems

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    32

    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.
    - Tigs

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    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!
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Registered User
    Join Date
    Jul 2002
    Posts
    32
    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.
    - Tigs

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows apps verses Console apps
    By nano78 in forum Windows Programming
    Replies: 8
    Last Post: 09-22-2007, 03:41 AM
  2. Script errors - bool unrecognized and struct issues
    By ulillillia in forum Windows Programming
    Replies: 10
    Last Post: 12-18-2006, 04:44 AM
  3. Windows app without console
    By Zeike in forum Windows Programming
    Replies: 4
    Last Post: 08-31-2005, 12:59 PM
  4. windows fonts for console
    By glUser3f in forum Game Programming
    Replies: 6
    Last Post: 10-21-2003, 04:50 AM
  5. console -> windows
    By itld in forum Windows Programming
    Replies: 1
    Last Post: 05-15-2002, 12:03 AM