#define WM_KEYLAST 264
#define WM_SYNCPAINT 136
#define WM_MOUSEACTIVATE 33
+#define WM_MOUSEFIRST 512
#define WM_MOUSEMOVE 512
#define WM_LBUTTONDOWN 513
#define WM_LBUTTONUP 514
#define WM_MBUTTONDOWN 519
#define WM_MBUTTONUP 520
#define WM_MBUTTONDBLCLK 521
+#if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
#define WM_MOUSEWHEEL 522
-#define WM_MOUSEFIRST 512
+#endif
#if (_WIN32_WINNT >= 0x0500)
#define WM_XBUTTONDOWN 523
#define WM_XBUTTONUP 524
#define WM_XBUTTONDBLCLK 525
+#endif
+#if (_WIN32_WINNT >= 0x0500)
#define WM_MOUSELAST 525
+#elif (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
+#define WM_MOUSELAST 522
+#else
+#define WM_MOUSELAST 521
#endif
#define WM_MOUSEHOVER 0x2A1
#define WM_MOUSELEAVE 0x2A3