I would like to catch a message which has been registered with
RegisterWindowMessage(). The message I'm talking about is the
MSWHEEL_ROLLMSG which has been identified as Registered
with Spy++. Everytime I start my computer the msg is different (0xcc9b
or 0xcc7f...). Is there any simple way to determine the RegisterMessage
(here MSWHEEL_ROLLMSG) ?
Regards,
Stefan Maton
Registered messages may have different message numbers every time
you boot your system. On my system MSWHEEL_ROLLMSG is 0xd0f2 at
the time I write this message.
MSWHEEL_ROLLMSG is a string that identifies the "MS Mouse wheel
rolled" message. The MS Mouse driver or whatever registers this
message by calling RegisterWindowMessage ("MSWHEEL_ROLLMSG") ;
Use this code:
UINT msWheelMessage ;
...
msWheelMessage = RegisterWinddowMessage ("MSWHEEL_ROLLMSG") ;
// now msWheelMessage contains the message number for
// the MS Mouse wheel.
later in your message loop:
switch (msg)
{
case WM_COMMAND:
...
break ;
case ...
...
break ;
default:
if (msg == msWheelMessage)
{
// process mouse wheel messages
...
}
}
With MFC use the ON_REGISTERED_MESSAGE macro within your message map.
Extract from VC++ help on RegisterWindowMessage:
If two different applications register the same message string, the
applications return the same message value. The message remains
registered until the Windows session ends.
Also have a look at the help form RegisterWindowMessage with VC++.
Michael Walz
wa...@lami.epfl.ch
if you call RegisterWindowMessage(MSWHEEL_ROLLMSG) you will get the numeric
code that will be used for "MSWHEEL_ROLLMSG".
Each application that will call RegisterWindowMessage with the same message
name will get the same message Id.
---
Valter Minute
min...@fortech.it (the reply address is invalid because I'm not looking for
latest Pam Anderson's videos, cheap CD-ROMs or "how to make a lot of $$$ by
spam" messages)
www.fortech.it/english
---
Are you looking for a good freeware ScreenSaver? Try FOYD!
http://www.winsite.com/info/pc/win95/desktop/foyd1295.zip/
if you want, I can send you the (free) C++ source code.
Valter Minute schrieb:
> if you call RegisterWindowMessage(MSWHEEL_ROLLMSG) you will get the numeric
> code that will be used for "MSWHEEL_ROLLMSG".
> Each application that will call RegisterWindowMessage with the same message
> name will get the same message Id.
>
> ---
> Valter Minute
Hi,
thanks for the quick answer... It works now...
Regards,
Stefan Maton