Function 37
and its subfunctions (0-8) - work with the mouse
Subfunction 0 - screen coordinates of the mouse
Options:
* eax =
37 - function number
* ebx = 0
- number of subfunction
Return value:
* eax = x
* 65536 + y, (x, y) = coordinates of the mouse cursor (counting from 0)
Subfunction 1 - coordinates of the mouse relative to the window
Options:
* eax =
37 - function number
* ebx = 1
- number of subfunction
Return value:
* eax = x
* 65536 + y, (x, y) = coordinates of the mouse cursor relative to
application windows
(counting from 0)
Remarks:
The value is
calculated by the formula (x-xwnd) * 65536 + (y-ywnd).
If y>
= ywnd, then the low word is non-negative and
contains the relative y-coordinate, and the high-order contains the relative
x-coordinate (of the correct sign).
Otherwise, the low word is
negative and still contains the relative y-coordinate, and the high word should
be added 1.
Subfunction 2 - mouse button states
Options:
* eax =
37 - function number
* ebx = 2
- subfunction number
Return value:
* eax =
bits 0-4 correspond to subfunctions 3
Subfunction 3 - states and events of the mouse buttons
Options:
* eax =
37 - function number
* ebx = 3
- subfunction number
Return value:
* eax
contains the following information:
states:
* bit 0 set = left button held down
* bit 1 is set = right button is
held
* bit 2 set = middle button held down
* bit 3 is set = button 4 is held
* bit 4 is set = button 5 is held
developments:
* bit 8 set = left button pressed
* bit 9 set = right button pressed
* bit 10 set = middle button pressed
* Bit 15 is set = Vertical scrolling is in use.
* bit 16 set = left button released
* bit 17 set = right button released
* bit 18 set = middle button released
* bit 23 is set = horizontal scroll
is used
* bit 24 is set = double left click
Subfunction 4 - load the cursor
Options:
* eax =
37 - function number
* ebx = 4
- subfunction number
* dx = data source:
* dx = LOAD_FROM_FILE = 0 - data in
the file
* ecx
= pointer to the full path to the cursor file
* the cursor file must
be in the .cur format, standard for MS Windows, with a size of 32 * 32 pixels
* dx = LOAD_FROM_MEM = 1 - the file
data is already loaded into memory
* ecx
= pointer to cursor file data
* data format is the
same as in the previous case.
* dx = LOAD_INDIRECT = 2 - data in
memory
* ecx
= pointer to the image of the cursor in ARGB format 32 * 32 pixels
* edx
= 0xXXYY0002, where
* Xx = x-coordinate of the cursor
hot spot
* YY = y-coordinate
* 0 <= XX, YY <= 31
Return value:
* eax = 0
- failure
* otherwise eax
= cursor handle
Subfunction 5 - set the cursor
Sets a new cursor for the current stream window.
Options:
* eax =
37 - function number
* ebx = 5
- subfunction number
* ecx =
cursor handle
Return value:
* eax =
handle of previous cursor set
Remarks:
If an incorrect
handle is passed, the function will restore the cursor to the default (standard
arrow). In particular, ecx = 0 results in restoring
the cursor by default.
Subfunction 6 - delete the cursor
Options:
* eax =
37 - function number
* ebx = 6
- subfunction number
* ecx =
cursor handle
Return value:
* eax
collapses
Remarks:
The cursor should
have been previously loaded by the current thread (by calling subfunction 4). The function does not delete system cursors
and cursors loaded by other applications.
If the active (set by
subfunction 5) cursor is deleted, then the default
cursor is restored (standard arrow).
Subfunction 7 - scroll data
Options:
* eax =
37 - function number
* ebx = 7
- subfunction number
Return value:
* eax =
[horizontal offset] * 65536 + [vertical offset]
Remarks:
Data is available
only to the active window.
After reading the
values are reset.
The data has sign
values.
Subfunction 8 - load the cursor with encoding indication
Options:
* eax =
37 - function number
* ebx = 8
- number of subfunction
* ecx =
pointer to the string with the path to the cursor file
* edx =
string encoding, details are provided in function 80 description.
Return value:
* eax =
cursor handle, 0 - failure
Constants for registers:
eax -
SF_MOUSE_GET (37)
ebx -
SSF_SCREEN_POSITION (0), SSF_WINDOW_POSITION (1),
SSF_BUTTON (2), SSF_BUTTON_EXT (3),
SSF_LOAD_CURSOR (4),
SSF_SET_CURSOR (5), SSF_DEL_CURSOR (6),
SSF_SCROLL_DATA (7)