Thread: Disable the cursor

  1. #1
    bored to death
    Guest

    Disable the cursor

    How can we change the cursor to a null cursor in VC++ win32 console applications??

    Also is there any way to copy the text on the console in a string!!

    Thankx in advance...

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>> change the cursor to a null cursor in VC++ win32 console applications

    Use the SetConsoleCursorInfo() API function, look it up in the help.

    >>> way to copy the text on the console in a string

    Since you put all the text there, surely you already have access to this?
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    bored to death
    Guest
    Ok thanks for part 1

    However I require to read all the text on the console so that even after the screen in cleared i can restore it again. Something like:

    char Screen[4096];//global variable

    GetScreen(Screen);

    system("cls");

    cout<<Screen;

    Thanks in advance

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    I'm not sure you can do this, I've never tried, but I don't recall any API function for getting the console buffer's contents, GetConsoleScreenBufferInfo() will give you the current screen buffer settings.

    Again, I would suggest that as you've written the stuff, you already know what was there. Create a dummy buffer and write everything into this buffer at the same time you write to the console, you can then redraw it if necessary, (kind of like a memory DC and a BitBlt() function). I can't think why you would want to do this.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. get visible mouse cursor height
    By eXistenZ in forum Windows Programming
    Replies: 10
    Last Post: 09-05-2008, 09:46 PM
  2. Custom Animated Cursor
    By willc0de4food in forum Windows Programming
    Replies: 3
    Last Post: 05-13-2005, 10:05 PM
  3. cursor
    By Mr Learn in forum C Programming
    Replies: 1
    Last Post: 04-19-2002, 11:30 PM
  4. cursor remains in openGL fullscreen
    By Ken Fitlike in forum Game Programming
    Replies: 5
    Last Post: 03-14-2002, 08:52 PM
  5. Mouse in 800x600 24Bit Mode?
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 11-11-2001, 01:38 AM