Thread: Set Console Cursor Style ?

  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 10: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, 10: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, 09:59 PM
  4. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM