onScroll (Callback)


onScroll (pos, hWnd, direction)

This callback function is used to process scrolling events

Parameter Description
pos The new scrolling position
hWnd The handle to the window that was scrolled
direction The scrollbar that was used in the scrolling

Returns

0

Remarks

This is a callback function. You must supply this function yourself. Register this callback with the WinXRegOnScroll callback function.

The direction parameter identifies the scrollbar which generated the scrolling event. Possible values are:

$$DIR_HORIZ
The horizontal scrollbar generated the event
$$DIR_VERT
The vertical scrollbar generated the event

Examples

'echo the scrolling position
FUNCTION onScroll (pos, hWnd, direction)

'create static variables to hold the scrolling position
STATIC x
STATIC y

'change x or y depending on the direction
SELECT CASE direction

CASE $$DIR_HORIZ

x = pos

CASE $$DIR_VERT

y = pos

END SELECT

'now print the results
PRINT "x: ";x;"y: ";y

END FUNCTION

Related Links

WinXRegOnScroll
WinXScroll_Update
WinXScroll_Scroll
Scrolling