How can I use GetKeyState to detect if the mouse's back or forward button is down when I receive a mouse event? MSDN's virtual key code list seems to define only left, right and middle mouse buttons.
Callback method that is passed to SetWindowsHookEx:
[MethodImpl(MethodImplOptions.NoInlining)]
private IntPtr LowLevelMouseProc(int nCode, UIntPtr wParam, IntPtr lParam)
{
Debug.WriteLine(wParam.ToUInt32());
Debug.WriteLine("MK_XBUTTON1: " + (wParam.ToUInt32() & 0x20));
Debug.WriteLine("MK_XBUTTON2: " + (wParam.ToUInt32() & 0x40));
}
Outputs the following when either back or forward is pressed:
523
MK_XBUTTON1: 0
MK_XBUTTON2: 0
524
MK_XBUTTON1: 0
MK_XBUTTON2: 0