Kai Tietz | 9d937a7 | 2007-08-10 10:41:48 +0000 | [diff] [blame] | 1 | /** |
Rafaël Carré | 8a67ab4 | 2012-06-28 15:40:59 +0000 | [diff] [blame] | 2 | * This file is part of the mingw-w64 runtime package. |
Kai Tietz | 6938721 | 2013-12-10 11:03:58 +0000 | [diff] [blame] | 3 | * No warranty is given; refer to the file DISCLAIMER within this package. |
Kai Tietz | 9d937a7 | 2007-08-10 10:41:48 +0000 | [diff] [blame] | 4 | */ |
Kai Tietz | d7a86e7 | 2010-06-12 14:47:39 +0000 | [diff] [blame] | 5 | |
Doug Semler | 4727c8b | 2010-06-18 23:17:52 +0000 | [diff] [blame] | 6 | #include <_mingw_unicode.h> |
Jonathan Yong | 28e642f | 2010-09-10 15:56:19 +0000 | [diff] [blame] | 7 | #include <psdk_inc/_push_BOOL.h> |
Doug Semler | 4727c8b | 2010-06-18 23:17:52 +0000 | [diff] [blame] | 8 | |
Kai Tietz | d7a86e7 | 2010-06-12 14:47:39 +0000 | [diff] [blame] | 9 | #define MSH_MOUSEWHEEL __MINGW_STRING_AW("MSWHEEL_ROLLMSG") |
Kai Tietz | 9d937a7 | 2007-08-10 10:41:48 +0000 | [diff] [blame] | 10 | |
| 11 | #define WHEEL_DELTA 120 |
| 12 | |
| 13 | #ifndef WM_MOUSEWHEEL |
| 14 | #define WM_MOUSEWHEEL (WM_MOUSELAST+1) |
| 15 | #endif |
| 16 | |
Kai Tietz | d7a86e7 | 2010-06-12 14:47:39 +0000 | [diff] [blame] | 17 | #define MOUSEZ_CLASSNAME __MINGW_STRING_AW("MouseZ") |
| 18 | #define MOUSEZ_TITLE __MINGW_STRING_AW("Magellan MSWHEEL") |
Kai Tietz | 9d937a7 | 2007-08-10 10:41:48 +0000 | [diff] [blame] | 19 | |
| 20 | #define MSH_WHEELMODULE_CLASS (MOUSEZ_CLASSNAME) |
| 21 | #define MSH_WHEELMODULE_TITLE (MOUSEZ_TITLE) |
| 22 | |
Kai Tietz | d7a86e7 | 2010-06-12 14:47:39 +0000 | [diff] [blame] | 23 | #define MSH_WHEELSUPPORT __MINGW_STRING_AW("MSH_WHEELSUPPORT_MSG") |
| 24 | #define MSH_SCROLL_LINES __MINGW_STRING_AW("MSH_SCROLL_LINES_MSG") |
Kai Tietz | 9d937a7 | 2007-08-10 10:41:48 +0000 | [diff] [blame] | 25 | |
| 26 | #ifndef WHEEL_PAGESCROLL |
| 27 | #define WHEEL_PAGESCROLL (UINT_MAX) |
| 28 | #endif |
| 29 | |
| 30 | #ifndef SPI_SETWHEELSCROLLLINES |
| 31 | #define SPI_SETWHEELSCROLLLINES 105 |
| 32 | #endif |
| 33 | |
Kai Tietz | 2bde047 | 2009-07-27 07:52:28 +0000 | [diff] [blame] | 34 | #ifndef __CRT__NO_INLINE |
Kai Tietz | 6938721 | 2013-12-10 11:03:58 +0000 | [diff] [blame] | 35 | __CRT_INLINE HWND HwndMSWheel (PUINT puiMsh_MsgMouseWheel, PUINT puiMsh_Msg3DSupport, PUINT puiMsh_MsgScrollLines, PBOOL pf3DSupport, PINT piScrollLines) { |
| 36 | HWND hw = FindWindow (MSH_WHEELMODULE_CLASS, MSH_WHEELMODULE_TITLE); |
Kai Tietz | 2bde047 | 2009-07-27 07:52:28 +0000 | [diff] [blame] | 37 | |
Kai Tietz | 6938721 | 2013-12-10 11:03:58 +0000 | [diff] [blame] | 38 | *puiMsh_MsgMouseWheel = RegisterWindowMessage (MSH_MOUSEWHEEL); |
| 39 | *puiMsh_Msg3DSupport = RegisterWindowMessage (MSH_WHEELSUPPORT); |
| 40 | *puiMsh_MsgScrollLines = RegisterWindowMessage (MSH_SCROLL_LINES); |
| 41 | *pf3DSupport = (*puiMsh_Msg3DSupport ? (WINBOOL) SendMessage (hw, *puiMsh_Msg3DSupport, 0, 0) : FALSE); |
| 42 | *piScrollLines = (*puiMsh_MsgScrollLines ? (int)SendMessage (hw, *puiMsh_MsgScrollLines, 0, 0) : 3); |
| 43 | return hw; |
| 44 | } |
| 45 | #endif |
| 46 | |
| 47 | #include <psdk_inc/_pop_BOOL.h> |