Sign in to follow this  

Ignoring WM_SETCURSOR

This topic is 4855 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
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

This topic is 4855 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this