We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,007 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Alternative for _setcursortype(_NOCURSOR);

Hello folks!
i am using DEV C++ to code
now i am working at a game in console
and i have a problem with the _setcursortype(_NOCURSOR); function
i set it but the cursor is still like _NORMALCURSOR
in Turbo C works perfectly in DEV not (
i tried to set like this _setcursortype(0); also don't have effect

i am just wondering if there is another alternative way to remove cursor from console?
my game looks very bad with the cursor active

pls help
thx in advance

2
Contributors
2
Replies
3 Hours
Discussion Span
11 Months Ago
Last Updated
5
Views
Question
Answered
thendrluca
Newbie Poster
20 posts since Oct 2011
Reputation Points: 10
Solved Threads: 2
Skill Endorsements: 0
Sokurenko
Junior Poster
111 posts since May 2012
Reputation Points: 42
Solved Threads: 13
Skill Endorsements: 0
Question Answered as of 11 Months Ago by Sokurenko

Alternative for _setcursortype(_NOCURSOR);

void ShowCursor(bool show) {
    HANDLE hConsoleOutput;
    CONSOLE_CURSOR_INFO structCursorInfo;

    hConsoleOutput = GetStdHandle( STD_OUTPUT_HANDLE );

    GetConsoleCursorInfo( hConsoleOutput, &structCursorInfo );

    structCursorInfo.bVisible = show;

    SetConsoleCursorInfo( hConsoleOutput,
    &structCursorInfo );

}

in program tu use like this
ShowCursor(false);

My question, my answer..very active users )

thendrluca
Newbie Poster
20 posts since Oct 2011
Reputation Points: 10
Solved Threads: 2
Skill Endorsements: 0

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0543 seconds using 2.59MB