Edorion
Edorion

Reputation: 23

Hiding mouse cursor

I am using bgfx in c99 to experiment with game dev / game engine dev, so I need to hide my cursor using Windows.h / WinUser.h

However even if I use ShowCursor(false), SetCursor(NULL) the cursor will still appear on screen.

None of the solutions I tried worked. Any help ? Thanks

Upvotes: 0

Views: 343

Answers (1)

YangXiaoPo-MSFT
YangXiaoPo-MSFT

Reputation: 2130

According to SetCursor,

The cursor is a shared resource. A window should set the cursor shape only when the cursor is in its client area or when the window is capturing mouse input. In systems without a mouse, the window should restore the previous cursor before the cursor leaves the client area or before it relinquishes control to another window.

If your application must set the cursor while it is in a window, make sure the class cursor for the specified window's class is set to NULL.(SetClassLong) If the class cursor is not NULL, the system restores the class cursor each time the mouse is moved.

ShowCursor sets an internal display counter that determines whether the cursor should be displayed.(Application-Oriented,Tried) The cursor is displayed only if the display count is greater than or equal to 0. If a mouse is installed, the initial display count is 0. If no mouse is installed, the display count is –1.

Upvotes: -1

Related Questions