Sorry to dig this up, but I succeeded... somewhat

The original topic, that is. I got the game to recognize button 4 and button 5 of the mouse. Only minor problem is once you push it, it never stops -- keeps firing.

So I'm stuck. Not sure what I did wrong. But I'll post the information if anyone else wants to take a crack at it.
In fs2_open\code\OsApi\OsApi.cpp , right after the "case WM_MBUTTONUP:" section, I added this:
case 0x020B: //WM_XBUTTONDOWN:
{
if (wParam & 0x0020) //MK_XBUTTON1)
mouse_mark_button( MOUSE_X1_BUTTON, 1 );
if (wParam & 0x0040) //MK_XBUTTON2)
mouse_mark_button( MOUSE_X2_BUTTON, 1 );
}
return true;
break;
case 0x020C: //WM_XBUTTONUP:
{
if (wParam & 0x0020) //MK_XBUTTON1)
mouse_mark_button( MOUSE_X1_BUTTON, 0 );
if (wParam & 0x0040) //MK_XBUTTON2)
mouse_mark_button( MOUSE_X2_BUTTON, 0 );
}
return true;
break;
Obviously you'll have to also modify fs2open\code\io\mouse.cpp and mouse.h to support more than 3 buttons (the MOUSE_X1_BUTTON and MOUSE_X2_BUTTON are names I made), but that's easy; mostly just cut and paste and modify.
I got the information from
http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/mouseinput/aboutmouseinput.asp, and also the hex codes from WinUser.h in the PlatformSDK.
There's also mousewheel possibilities:
case 0x020A: //WM_MOUSEWHEEL:
{
if (wParam > 0) // Scrolling up
{ // put something here
}
else if (wParam < 0) // Scrolling down
{ // put something here
}
}
break;