Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to control MS Mouse's back/forword buttons?

0 views
Skip to first unread message

Hiu Sing Ngai

unread,
Apr 12, 2002, 9:10:25 PM4/12/02
to
Hello,
MS mouses have a back/forward button on the side, these buttons work
great in I Explorer. I would like to support those buttons in my
application. How do I detect those key in my application?

Thanks,
Hiusing


Robola

unread,
Apr 14, 2002, 2:11:34 PM4/14/02
to
Hello Siu Sing Ngai:

To process these buttons command your app will need to handle the
appropriate WM_APPCOMMAND messages.

The documentation is on the MS Web-Site at is quite clear:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/keybi
npt_8sbo.asp

Here a brief bit of code I put in a Win32 app to demonstrate for you. As
per the documentation this code only works for Win ME or later Win2k, so be
sure to #define _WIN32_WINNT 0x500 before including windows.h

case WM_APPCOMMAND:
{
int cmd = GET_APPCOMMAND_LPARAM(lParam); // to crack the value of
the LPARAM

if (cmd == APPCOMMAND_BROWSER_BACKWARD)
::MessageBox (NULL, "Back button pressed", NULL, MB_OK);

if (cmd == APPCOMMAND_BROWSER_FORWARD)
::MessageBox (NULL, "Forward button pressed", NULL, MB_OK);
}
break;

Hope this helps!

Robola;

Hiu Sing Ngai

unread,
Apr 16, 2002, 6:49:57 PM4/16/02
to
Hello Robola,
Thank you so much! WM_APPCOMMAND is what I'm looking for.

Thanks,
Hiu Sing Ngai

"Robola" <xmar...@adrastea.co.uk> wrote in message
news:a9cgom$glp$1...@helle.btinternet.com...

0 new messages