Jump to content
  • Advertisement
Sign in to follow this  
d000hg

WM_MOUSEWHEEL support in VS6?

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

I tried first to add support for this message but was told that WM_MOUSEWHEEL was undefined. I found I needed to re-define _WIN32_WINNT 0x0400, although I thought this was automatically determined for the Windows I'm compiling on (Win2000). Now I get the messages OK, but the parameter containing the delta is always zero. I am using a MS wheel mouse.

Share this post


Link to post
Share on other sites
Advertisement
	case 0x020A://WM_MOUSEWHEEL
if( (short)HIWORD(wParam) > 0)
{
keys[INF_KEY_MW_UP] = TRUE;
keys[INF_KEY_MW_DOWN] = FALSE;
} else
if( (short)HIWORD(wParam) < 0)
{
keys[INF_KEY_MW_UP] = FALSE;
keys[INF_KEY_MW_DOWN] = TRUE;
} else
{
keys[INF_KEY_MW_UP] = FALSE;
keys[INF_KEY_MW_DOWN] = FALSE;
}
return 0;


Works fine for me. VS6 w/ Xp(currently), Me(previous) or 2k(school).

Share this post


Link to post
Share on other sites
As sirGustav uses (and the SDK documents), HIWORD(wParam) is what I test. But it is always zero! I'll check it's not a stupid error like passing the wrong parameter before getting too confused. But Why did I have to re-define the windows version to make it compile?

Share this post


Link to post
Share on other sites
It's just to make sure that you know that your code will not work on older versions of windows.

Another shot in the dark: Make sure you test "if(delta==0)" and not "if(delta=0)" [SMILE]

Share this post


Link to post
Share on other sites
As if I'd make such a newB error!

Fixed it - I was passing wParam through to another method, which took the parameter as a WORD, not a DWORD - suprisingly enough the HIWORD() value was always zero!

Thanks for your help guys.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!