# WM_MOUSEWHEEL support in VS6?

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

## 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 on other sites
Can you post the code where you read the delta? If you're not already using it, use GET_WHEEL_DELTA_WPARAM.

##### Share on other sites
	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 on other sites
You should also divide the delta by a constant (which is currently defined as 120). Sometimes you get more than one wheel tick inside WM_MOUSEWHEEL.

##### 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 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 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!

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 9
• 13
• 9
• 9
• 15
• ### Forum Statistics

• Total Topics
634078
• Total Posts
3015362
×