Jump to content
  • Advertisement
Sign in to follow this  
Tertsi

Ignoring WM_SETCURSOR

This topic is 5022 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can I get the below message handler to ignore the msg WM_SETCURSOR? The obvious if(msg != WM_SETCURSOR) can't be used due to a compiler error. Here's my app's msg handler.
LRESULT CALLBACK WinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	return DefWindowProc(hWnd, msg, wParam, lParam);
}



and here's the loop in Winmain which calls that handler, right?
do
	{
		if(PeekMessage(&msg, hWnd, 0, 0, PM_REMOVE))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}

		game->update_game();
	}
	while(game->is_running());



Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Tertsi
How can I get the below message handler to ignore the msg WM_SETCURSOR?

The obvious if(msg != WM_SETCURSOR) can't be used due to a compiler error.


LRESULT CALLBACK WinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if(msg == WM_SETCURSOR)
return 0;
return DefWindowProc(hWnd, msg, wParam, lParam);
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!