MouseMoveWin

Mouse movement event with window coordinates.
[event] MouseMoveWin([in] short button, [in] short shift, [in] int winX, [in] int winY)
This event will be called when the user moves the mouse.

Mouse events must be enabled first - see enableMouseEvents and enableMouseMoveEvents.

The event will be called with four arguments:

Window coordinates can be converted to PDF coordinates with convertWindowToPDFCoords2.

This event is similar to MouseMove2, except that (a) it is called with window coordinates instead of PDF coordinates, and (b) it will be called even if the mouse is moved outside of a PDF page.

IMPORTANT: In order to receive MouseMoveWin and MouseUpWin events when the mouse is outside the XpdfViewer window (not just outside the PDF pages), you must call SetCapture in the MouseDownWin event handler. See the example below.

VB6:
viewer.enableMouseEvents = True viewer.enableMouseMoveEvents = True ... Private Sub viewer_MouseDownWin(ByVal button As Integer, ByVal shift As Integer, _ ByVal winX As Long, ByVal winY As Long) Dim pg As Long, x As Double, y As Double viewer.convertWindowToPDFCoords2 winX, winY, pg, x, y ' ... use pg, x, y ... ' capture the mouse so we receive MoveWin and UpWin events outside the window SetCapture viewer.windowHandle End Sub Private Sub viewer_MouseUpWin(ByVal button As Integer, ByVal shift As Integer, _ ByVal winX As Long, ByVal winY As Long) ' release the capture that was initiated in MouseDownWin ReleaseCapture Dim pg As Long, x As Double, y As Double viewer.convertWindowToPDFCoords2 winX, winY, pg, x, y ' ... use pg, x, y ... End Sub Private Sub viewer_MouseMoveWin(ByVal button As Integer, ByVal shift As Integer, _ ByVal winX As Long, ByVal winY As Long) Dim pg As Long, x As Double, y As Double viewer.convertWindowToPDFCoords2 winX, winY, pg, x, y ' ... use pg, x, y ... End Sub Private Sub viewer_MouseDoubleClickWin(ByVal button As Integer, ByVal shift As Integer, _ ByVal winX As Long, ByVal winY As Long) Dim pg As Long, x As Double, y As Double viewer.convertWindowToPDFCoords2 winX, winY, pg, x, y ' ... use pg, x, y ... End Sub
MouseDownWin
MouseUpWin
MouseDoubleClickWin
enableMouseEvents
enableMouseMoveEvents
convertWindowToPDFCoords2
MouseMove2