How to hide the mouse?

Started by
5 comments, last by jimywang 20 years, 5 months ago
I have done a little full screen game using DirectX 8.0.I have a problem with hiding the mouse in the game.Can anyone tell me how to hide the mouse in a Win32 full screen program plz?Thx regards
Advertisement
ShowCursor(false);
ShowCursor (FALSE);

false is a C++ bool, FALSE is a Win32 BOOL. There''s a difference.

Why you shouldn''t use iostream.h - ever! | A Good free online C++ book
It should be noted that ShowCursor does somthing like ''Reference Coutning'' in that if, you call ShowCursor(FALSE); 2 times
then call ShowCursor(TRUE); once it wont show the cursor.

in order to get an effect you must show as many times as you hide, so what i do is make a function that makes reference to variable.

m_cursorvisible=true;//set to true as default

void ShowCursor(bool show)
{
if(show)
{
if(!m_cursorvisible)
{
ShowCursor(TRUE);
m_cursorvisible=true;
}
}
else
{
if(m_cursorvisible)
{
ShowCursor(FALSE);
m_cursorvisible=false;
}
}
}

this will keep everything synced apropriatly.

of course the counting mechanisim is helpful if you have some weird nesting calls to the ShowCursor function, wherein you only want a change at the begining and end of the matched nest.


Raymond Jacobs,

www.EDIGames.com

www.EtherealDarkness.com

Raymond Jacobs, Owner - Ethereal Darkness Interactive
www.EDIGames.com - EDIGamesCompany - @EDIGames

Put it under the mouse pad.

--
Dave Mikesell Software & Consulting
Sorry, but LOL :D
LOL. That is the best reply to any thread I have ever seen here! Seriously.

This topic is closed to new replies.

Advertisement