Set Console Cursor Style ?

This is a discussion on Set Console Cursor Style ? within the C++ Programming forums, part of the General Programming Boards category; Quick question, whats the function to set the console cursor style... (ie: blinking block instead of blinking line) thanks in ...

  1. #1
    Registered User Liam Battle's Avatar
    Join Date
    Jan 2002
    Posts
    114

    Set Console Cursor Style ?

    Quick question, whats the function to set the console cursor style... (ie: blinking block instead of blinking line)

    thanks in advance.
    LB0: * Life once school is done
    LB1: N <- WakeUp;
    LB2: N <- C++_Code;
    LB3: N >= Tired : N <- Sleep;
    LB4: JMP*-3;

  2. #2
    Registered User Invincible's Avatar
    Join Date
    Feb 2002
    Posts
    210
    If you're talking about the windows console:

    Code:
    #include <iostream>
    #include <windows.h>
    using namespace std;
    
    int main()
    {
    	HANDLE hout; //handle to the console
    	CONSOLE_CURSOR_INFO cursor;//cursor struct
    	hout = GetStdHandle(STD_OUTPUT_HANDLE);
            //set our handle for output
    
    	cursor.dwSize = 100;
    	//the structure member dwsize of
            //CONSOLE_CURSOR_INFO takes an int argument 
            //from 1-100, and the next function uses this
            //value to change the size of the cursor
            //accordingly
    
    	SetConsoleCursorInfo(hout, &cursor);
    	//pass the cursor info structure and our handle
    	//to this function and we're done :)
    
    	//you can also change the visibility of the cursor
    	//with the structures other member called bVisible
    
    	return 0;
    }


    Hope this helps, Incvincible
    Last edited by Invincible; 05-29-2002 at 11:57 PM.
    "The mind, like a parachute, only functions when open."

  3. #3
    Registered User Liam Battle's Avatar
    Join Date
    Jan 2002
    Posts
    114
    Thanks bud...
    In 3 years i never had to changed the console cursor style... haha... too used to win32-GUI and my own home made console routines...
    LB0: * Life once school is done
    LB1: N <- WakeUp;
    LB2: N <- C++_Code;
    LB3: N >= Tired : N <- Sleep;
    LB4: JMP*-3;

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. optimising program
    By SONU in forum C Programming
    Replies: 1
    Last Post: 05-18-2008, 11:28 AM
  2. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 02:39 PM
  3. Full Screen Console
    By St0rmTroop3er in forum C++ Programming
    Replies: 1
    Last Post: 09-26-2005, 10:59 PM
  4. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 11:17 AM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 11:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21