#### Archived

This topic is now archived and is closed to further replies.

# WM_MOUSEWHEEL message

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

## Recommended Posts

I was trying to use the WM_MOUSEWHEEL message in my map editor, but VC++ claimed it didn''t exist. But I''m pretty sure it does exist as it''s discussed in the MSDN help file . Do I need to get a new version windows.h to use it? (where I''m assuming it''s declared). And if so, where might I find this new version of the file? BTW, I''m using VC++6 (service pack 2). Thanks for any help --TheGoop

##### Share on other sites
Dig some in the windows include files (winuser.h) and you will eventually find something that says:

#if (_WIN32_WINNT >= 0x0400) // (_WIN32_WINDOWS > 0x0400)#define WM_MOUSEWHEEL 0x020A...#endif

This happend to me too (other define though).
Solution: define _WIN32_WINDOWS to a proper value or simply define WM_MOUSEWHEEL.
I have no idea why it doesn't work though (Yes, I do have the proper windows version).

"Paranoia is the belief in a hidden order behind the visible." - Anonymous

Edited by - Staffan on 4/8/00 6:39:06 PM

##### Share on other sites
Hmm, I searched for that line in WinUser.h but it didn''t appear. The problem is that I need the GET_WHEEL_DELTA_WPARAM macro to decipher the data WM_MOUSEWHEEL sends me. Apparently I''ll have to get some new windows header files. Would those be in the Platform SDK?

--TheGoop

##### Share on other sites
To get it working i had to do this i''m not sure why they don''t just have it enabled.

//To enable it define this
#ifndef WM_MOUSEWHEEL
#define WM_MOUSEWHEEL 0x020A
#endif

//Use it like this
if(msg.message==WM_MOUSEWHEEL)
{
zDelta = (short) HIWORD(msg.wParam);
if(zDelta > 0)
{
//roll direction
//do whatever you want
}
if(zDelta < 0)
{
//roll other direction
//do whatever you want
}
}

Hope this helps.

--Fuel

##### Share on other sites
The WM_MOUSEWHEEL message only works under Windows 98 by default. I don''t know if any of these suggestions work, but I do know that Windows 95 doesn''t recognize the message..

------------------------------
Jonathan Little
http://www.crosswinds.net/~uselessknowledge

##### Share on other sites
I''ve gotten it to intercept the WM_MOUSEWHEEL message OK now, but I can''t figure out how to find how much it rolled (i.e the delta).

I tried taking the HIWORD of the wParam like someone suggested, but that doesn''t seem to work: It gives me a 120 as the delta when I move the wheel up (as expected), but when I move the wheel down it gives me 65,416 -- which is just plain odd.

Any ideas?

--TheGoop

##### Share on other sites
TheGoop, It seems that you just overlooked to cast WORD variable to SHORT one. The delta you receive when mouse wheel was moved is signed. It gives you -120 not 65,416

Kwanji - a game developer in Japan.

##### Share on other sites

Doh! I should have seen that. Thanks

--TheGoop

##### Share on other sites
Confirming what Qoy said:

The network in my college uses Win95, and the MouseWheels work only on computers that have a program running in the taskbar.

George.

"Who says computer games affect kids, imagine if PacMan affected us as kids, we'd all sit around in a darkened room munching pills and listening to repetitive music....uh oh!"

##### Share on other sites
hi

how do i get if the mousewheel was pressed ?? (mine mouse allows it) i think its called mouse button 3 but the messagesa are only LMOUSEDOWN RMOUSEDown

thks

1. 1
Rutin
27
2. 2
3. 3
4. 4
5. 5

• 11
• 11
• 10
• 13
• 20
• ### Forum Statistics

• Total Topics
632948
• Total Posts
3009399
• ### Who's Online (See full list)

There are no registered users currently online

×