1
{******************************************************************************}
3
{ Intellimouse API interface Unit for Object Pascal }
5
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
6
{ Corporation. All Rights Reserved. }
8
{ The original file is: zmouse.h, released June 2000. The original Pascal }
9
{ code is: ZMOUSE.pas, released December 2000. The initial developer of the }
10
{ Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
12
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
13
{ Marcel van Brakel. All Rights Reserved. }
15
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
17
{ You may retrieve the latest version of this file at the Project JEDI }
18
{ APILIB home page, located at http://jedi-apilib.sourceforge.net }
20
{ The contents of this file are used with permission, subject to the Mozilla }
21
{ Public License Version 1.1 (the "License"); you may not use this file except }
22
{ in compliance with the License. You may obtain a copy of the License at }
23
{ http://www.mozilla.org/MPL/MPL-1.1.html }
25
{ Software distributed under the License is distributed on an "AS IS" basis, }
26
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
27
{ the specific language governing rights and limitations under the License. }
29
{ Alternatively, the contents of this file may be used under the terms of the }
30
{ GNU Lesser General Public License (the "LGPL License"), in which case the }
31
{ provisions of the LGPL License are applicable instead of those above. }
32
{ If you wish to allow use of your version of this file only under the terms }
33
{ of the LGPL License and not to allow others to use your version of this file }
34
{ under the MPL, indicate your decision by deleting the provisions above and }
35
{ replace them with the notice and other provisions required by the LGPL }
36
{ License. If you do not delete the provisions above, a recipient may use }
37
{ your version of this file under either the MPL or the LGPL License. }
39
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
41
{******************************************************************************}
43
// $Id: jwazmouse.pas,v 1.1 2005/04/04 07:56:11 marco Exp $
52
JwaWinUser, JwaWinType;
54
{****************************************************************************
56
* ZMOUSE.H -- Include file for IntelliMouse(tm) 1.0 *
58
* NOTE: Zmouse.h contains #defines required when providing IntelliMouse *
59
* wheel support for Windows95 and NT3.51. Wheel is supported *
60
* natively in WinNT4.0, please refer to the NT4.0 SDK for more info *
61
* on providing support for IntelliMouse in NT4.0. *
63
* Copyright (c) 1983-1996, Microsoft Corp. All rights reserved. *
65
\***************************************************************************}
67
{**************************************************************************
68
Client Application (API) Defines for Wheel rolling
69
***************************************************************************}
71
// Apps need to call RegisterWindowMessage using the #define below to
72
// get the message number that is sent to the foreground window
73
// when a wheel roll occurs
77
MSH_MOUSEWHEEL = WideString('MSWHEEL_ROLLMSG');
78
{$EXTERNALSYM MSH_MOUSEWHEEL}
80
MSH_MOUSEWHEEL = 'MSWHEEL_ROLLMSG';
81
{$EXTERNALSYM MSH_MOUSEWHEEL}
84
// wParam = wheel rotation expressed in multiples of WHEEL_DELTA
85
// lParam is the mouse coordinates
87
WHEEL_DELTA = 120; // Default value for rolling one notch
88
{$EXTERNALSYM WHEEL_DELTA}
90
WM_MOUSEWHEEL = WM_MOUSELAST + 1; // message that will be supported by the OS
91
{$EXTERNALSYM WM_MOUSEWHEEL}
93
{**************************************************************************
94
Client Application (API) Defines for
95
* determining if wheel support active
96
* determining # of Scroll Lines
97
***************************************************************************}
99
// Class name for MSWHEEL.EXE's invisible window
100
// use FindWindow to get hwnd to MSWHEEL
103
MOUSEZ_CLASSNAME = WideString('MouseZ'); // wheel window class
104
{$EXTERNALSYM MOUSEZ_CLASSNAME}
105
MOUSEZ_TITLE = WideString('Magellan MSWHEEL'); // wheel window title
106
{$EXTERNALSYM MOUSEZ_TITLE}
108
MOUSEZ_CLASSNAME = 'MouseZ'; // wheel window class
109
{$EXTERNALSYM MOUSEZ_CLASSNAME}
110
MOUSEZ_TITLE = 'Magellan MSWHEEL'; // wheel window title
111
{$EXTERNALSYM MOUSEZ_TITLE}
114
MSH_WHEELMODULE_CLASS = MOUSEZ_CLASSNAME;
115
{$EXTERNALSYM MSH_WHEELMODULE_CLASS}
116
MSH_WHEELMODULE_TITLE = MOUSEZ_TITLE;
117
{$EXTERNALSYM MSH_WHEELMODULE_TITLE}
119
// Apps need to call RegisterWindowMessage using the #defines
120
// below to get the message numbers for:
121
// 1) the message that can be sent to the MSWHEEL window to
122
// query if wheel support is active (MSH_WHEELSUPPORT)>
123
// 2) the message to query for the number of scroll lines
124
// (MSH_SCROLL_LINES)
126
// To send a message to MSWheel window, use FindWindow with the #defines
127
// for CLASS and TITLE above. If FindWindow fails to find the MSWHEEL
128
// window or the return from SendMessage is false, then Wheel support
129
// is not currently available.
132
MSH_WHEELSUPPORT = WideString('MSH_WHEELSUPPORT_MSG'); // name of msg to send to query for wheel support
133
{$EXTERNALSYM MSH_WHEELSUPPORT}
135
MSH_WHEELSUPPORT = 'MSH_WHEELSUPPORT_MSG'; // name of msg to send to query for wheel support
136
{$EXTERNALSYM MSH_WHEELSUPPORT}
142
// returns BOOL - TRUE if wheel support is active, FALSE otherwise
145
MSH_SCROLL_LINES = WideString('MSH_SCROLL_LINES_MSG');
146
{$EXTERNALSYM MSH_SCROLL_LINES}
148
MSH_SCROLL_LINES = 'MSH_SCROLL_LINES_MSG';
149
{$EXTERNALSYM MSH_SCROLL_LINES}
155
// returns int - number of lines to scroll on a wheel roll
157
WHEEL_PAGESCROLL = UINT_MAX; // signifies to scroll a page, also
158
// defined in winuser.h in the NT4.0 SDK
159
{$EXTERNALSYM WHEEL_PAGESCROLL}
161
SPI_SETWHEELSCROLLLINES = 105; // Also defined in winuser.h in the
162
// NT4.0 SDK, please see the NT4.0 SDK
163
// documentation for NT4.0 implementation
165
// For Win95 and WinNT3.51,
166
// Mswheel broadcasts the message
167
// WM_SETTINGCHANGE (equivalent to
168
// WM_WININICHANGE) when the scroll
169
// lines has changed. Applications
170
// will recieve the WM_SETTINGCHANGE
171
// message with the wParam set to
172
// SPI_SETWHEELSCROLLLINES. When
173
// this message is recieved the application
174
// should query Mswheel for the new
176
{$EXTERNALSYM SPI_SETWHEELSCROLLLINES}
178
{*********************************************************************
179
* INLINE FUNCTION: HwndMsWheel
180
* Purpose : Get a reference to MSWheel Window, the registered messages,
181
* wheel support active setting, and number of scrollLines
182
* Params : PUINT puiMsh_MsgMouseWheel - address of UINT to contain returned registered wheel message
183
* PUINT puiMsh_Msg3DSupport - address of UINT to contain wheel support registered message
184
* PUINT puiMsh_MsgScrollLines - address of UINT to contain Scroll lines registered message
185
* PBOOL pf3DSupport - address of BOOL to contain returned flag for wheel support active
186
* PINT piScrollLines - address of int to contain returned scroll lines
187
* Returns : HWND handle to the MsWheel window
188
* Note : The return value for pf3DSupport and piScrollLines is dependant
189
* on the POINT32 module. If POINT32 module is not running then
190
* the values returned for these parameters will be
191
* FALSE and 3, respectively.
192
*********************************************************************}
194
function HwndMSWheel(var puiMsh_MsgMouseWheel, puiMsh_Msg3DSupport,
195
puiMsh_MsgScrollLines: UINT; var pf3DSupport: BOOL;
196
var piScrollLines: Integer): HWND;
197
{$EXTERNALSYM HwndMSWheel}
201
function HwndMSWheel(var puiMsh_MsgMouseWheel, puiMsh_Msg3DSupport,
202
puiMsh_MsgScrollLines: UINT; var pf3DSupport: BOOL;
203
var piScrollLines: Integer): HWND;
205
Result := FindWindow(MSH_WHEELMODULE_CLASS, MSH_WHEELMODULE_TITLE);
206
puiMsh_MsgMouseWheel := RegisterWindowMessage(MSH_MOUSEWHEEL);
207
puiMsh_Msg3DSupport := RegisterWindowMessage(MSH_WHEELSUPPORT);
208
puiMsh_MsgScrollLines := RegisterWindowMessage(MSH_SCROLL_LINES);
209
if (puiMsh_Msg3DSupport <> 0) and (Result <> 0) then
210
pf3DSupport := BOOL(SendMessage(Result, puiMsh_Msg3DSupport, 0, 0))
212
pf3DSupport := False; // default to FALSE
213
if (puiMsh_MsgScrollLines <> 0) and (Result <> 0) then
214
piScrollLines := SendMessage(Result, puiMsh_MsgScrollLines, 0, 0)
216
piScrollLines := 3; // default
1
{******************************************************************************}
3
{ Intellimouse API interface Unit for Object Pascal }
5
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
6
{ Corporation. All Rights Reserved. }
8
{ The original file is: zmouse.h, released June 2000. The original Pascal }
9
{ code is: ZMOUSE.pas, released December 2000. The initial developer of the }
10
{ Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
12
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
13
{ Marcel van Brakel. All Rights Reserved. }
15
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
17
{ You may retrieve the latest version of this file at the Project JEDI }
18
{ APILIB home page, located at http://jedi-apilib.sourceforge.net }
20
{ The contents of this file are used with permission, subject to the Mozilla }
21
{ Public License Version 1.1 (the "License"); you may not use this file except }
22
{ in compliance with the License. You may obtain a copy of the License at }
23
{ http://www.mozilla.org/MPL/MPL-1.1.html }
25
{ Software distributed under the License is distributed on an "AS IS" basis, }
26
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
27
{ the specific language governing rights and limitations under the License. }
29
{ Alternatively, the contents of this file may be used under the terms of the }
30
{ GNU Lesser General Public License (the "LGPL License"), in which case the }
31
{ provisions of the LGPL License are applicable instead of those above. }
32
{ If you wish to allow use of your version of this file only under the terms }
33
{ of the LGPL License and not to allow others to use your version of this file }
34
{ under the MPL, indicate your decision by deleting the provisions above and }
35
{ replace them with the notice and other provisions required by the LGPL }
36
{ License. If you do not delete the provisions above, a recipient may use }
37
{ your version of this file under either the MPL or the LGPL License. }
39
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
41
{******************************************************************************}
51
JwaWinUser, JwaWinType;
53
{****************************************************************************
55
* ZMOUSE.H -- Include file for IntelliMouse(tm) 1.0 *
57
* NOTE: Zmouse.h contains #defines required when providing IntelliMouse *
58
* wheel support for Windows95 and NT3.51. Wheel is supported *
59
* natively in WinNT4.0, please refer to the NT4.0 SDK for more info *
60
* on providing support for IntelliMouse in NT4.0. *
62
* Copyright (c) 1983-1996, Microsoft Corp. All rights reserved. *
64
\***************************************************************************}
66
{**************************************************************************
67
Client Application (API) Defines for Wheel rolling
68
***************************************************************************}
70
// Apps need to call RegisterWindowMessage using the #define below to
71
// get the message number that is sent to the foreground window
72
// when a wheel roll occurs
76
MSH_MOUSEWHEEL = WideString('MSWHEEL_ROLLMSG');
77
{$EXTERNALSYM MSH_MOUSEWHEEL}
79
MSH_MOUSEWHEEL = 'MSWHEEL_ROLLMSG';
80
{$EXTERNALSYM MSH_MOUSEWHEEL}
83
// wParam = wheel rotation expressed in multiples of WHEEL_DELTA
84
// lParam is the mouse coordinates
86
WHEEL_DELTA = 120; // Default value for rolling one notch
87
{$EXTERNALSYM WHEEL_DELTA}
89
WM_MOUSEWHEEL = WM_MOUSELAST + 1; // message that will be supported by the OS
90
{$EXTERNALSYM WM_MOUSEWHEEL}
92
{**************************************************************************
93
Client Application (API) Defines for
94
* determining if wheel support active
95
* determining # of Scroll Lines
96
***************************************************************************}
98
// Class name for MSWHEEL.EXE's invisible window
99
// use FindWindow to get hwnd to MSWHEEL
102
MOUSEZ_CLASSNAME = WideString('MouseZ'); // wheel window class
103
{$EXTERNALSYM MOUSEZ_CLASSNAME}
104
MOUSEZ_TITLE = WideString('Magellan MSWHEEL'); // wheel window title
105
{$EXTERNALSYM MOUSEZ_TITLE}
107
MOUSEZ_CLASSNAME = 'MouseZ'; // wheel window class
108
{$EXTERNALSYM MOUSEZ_CLASSNAME}
109
MOUSEZ_TITLE = 'Magellan MSWHEEL'; // wheel window title
110
{$EXTERNALSYM MOUSEZ_TITLE}
113
MSH_WHEELMODULE_CLASS = MOUSEZ_CLASSNAME;
114
{$EXTERNALSYM MSH_WHEELMODULE_CLASS}
115
MSH_WHEELMODULE_TITLE = MOUSEZ_TITLE;
116
{$EXTERNALSYM MSH_WHEELMODULE_TITLE}
118
// Apps need to call RegisterWindowMessage using the #defines
119
// below to get the message numbers for:
120
// 1) the message that can be sent to the MSWHEEL window to
121
// query if wheel support is active (MSH_WHEELSUPPORT)>
122
// 2) the message to query for the number of scroll lines
123
// (MSH_SCROLL_LINES)
125
// To send a message to MSWheel window, use FindWindow with the #defines
126
// for CLASS and TITLE above. If FindWindow fails to find the MSWHEEL
127
// window or the return from SendMessage is false, then Wheel support
128
// is not currently available.
131
MSH_WHEELSUPPORT = WideString('MSH_WHEELSUPPORT_MSG'); // name of msg to send to query for wheel support
132
{$EXTERNALSYM MSH_WHEELSUPPORT}
134
MSH_WHEELSUPPORT = 'MSH_WHEELSUPPORT_MSG'; // name of msg to send to query for wheel support
135
{$EXTERNALSYM MSH_WHEELSUPPORT}
141
// returns BOOL - TRUE if wheel support is active, FALSE otherwise
144
MSH_SCROLL_LINES = WideString('MSH_SCROLL_LINES_MSG');
145
{$EXTERNALSYM MSH_SCROLL_LINES}
147
MSH_SCROLL_LINES = 'MSH_SCROLL_LINES_MSG';
148
{$EXTERNALSYM MSH_SCROLL_LINES}
154
// returns int - number of lines to scroll on a wheel roll
156
WHEEL_PAGESCROLL = UINT_MAX; // signifies to scroll a page, also
157
// defined in winuser.h in the NT4.0 SDK
158
{$EXTERNALSYM WHEEL_PAGESCROLL}
160
SPI_SETWHEELSCROLLLINES = 105; // Also defined in winuser.h in the
161
// NT4.0 SDK, please see the NT4.0 SDK
162
// documentation for NT4.0 implementation
164
// For Win95 and WinNT3.51,
165
// Mswheel broadcasts the message
166
// WM_SETTINGCHANGE (equivalent to
167
// WM_WININICHANGE) when the scroll
168
// lines has changed. Applications
169
// will recieve the WM_SETTINGCHANGE
170
// message with the wParam set to
171
// SPI_SETWHEELSCROLLLINES. When
172
// this message is recieved the application
173
// should query Mswheel for the new
175
{$EXTERNALSYM SPI_SETWHEELSCROLLLINES}
177
{*********************************************************************
178
* INLINE FUNCTION: HwndMsWheel
179
* Purpose : Get a reference to MSWheel Window, the registered messages,
180
* wheel support active setting, and number of scrollLines
181
* Params : PUINT puiMsh_MsgMouseWheel - address of UINT to contain returned registered wheel message
182
* PUINT puiMsh_Msg3DSupport - address of UINT to contain wheel support registered message
183
* PUINT puiMsh_MsgScrollLines - address of UINT to contain Scroll lines registered message
184
* PBOOL pf3DSupport - address of BOOL to contain returned flag for wheel support active
185
* PINT piScrollLines - address of int to contain returned scroll lines
186
* Returns : HWND handle to the MsWheel window
187
* Note : The return value for pf3DSupport and piScrollLines is dependant
188
* on the POINT32 module. If POINT32 module is not running then
189
* the values returned for these parameters will be
190
* FALSE and 3, respectively.
191
*********************************************************************}
193
function HwndMSWheel(var puiMsh_MsgMouseWheel, puiMsh_Msg3DSupport,
194
puiMsh_MsgScrollLines: UINT; var pf3DSupport: BOOL;
195
var piScrollLines: Integer): HWND;
196
{$EXTERNALSYM HwndMSWheel}
200
function HwndMSWheel(var puiMsh_MsgMouseWheel, puiMsh_Msg3DSupport,
201
puiMsh_MsgScrollLines: UINT; var pf3DSupport: BOOL;
202
var piScrollLines: Integer): HWND;
204
Result := FindWindow(MSH_WHEELMODULE_CLASS, MSH_WHEELMODULE_TITLE);
205
puiMsh_MsgMouseWheel := RegisterWindowMessage(MSH_MOUSEWHEEL);
206
puiMsh_Msg3DSupport := RegisterWindowMessage(MSH_WHEELSUPPORT);
207
puiMsh_MsgScrollLines := RegisterWindowMessage(MSH_SCROLL_LINES);
208
if (puiMsh_Msg3DSupport <> 0) and (Result <> 0) then
209
pf3DSupport := BOOL(SendMessage(Result, puiMsh_Msg3DSupport, 0, 0))
211
pf3DSupport := False; // default to FALSE
212
if (puiMsh_MsgScrollLines <> 0) and (Result <> 0) then
213
piScrollLines := SendMessage(Result, puiMsh_MsgScrollLines, 0, 0)
215
piScrollLines := 3; // default