# EnableExtendedMouseEvents

int EnableExtendedMouseEvents (int panel, int ctrl, double minimumEventInterval);

## Purpose

This function enables a control to receive the following extended mouse events in addition to the usual mouse events.

EVENT_MOUSE_MOVE
EVENT_LEFT_MOUSE_UP
EVENT_RIGHT_MOUSE_UP

The following events are built–in LabWindows/CVI mouse events:

EVENT_LEFT_CLICK
EVENT_LEFT_DOUBLE_CLICK
EVENT_RIGHT_CLICK
EVENT_RIGHT_DOUBLE_CLICK

The built-in mouse events occur when the mouse button is pressed down.

For each event:

eventData1 is the vertical mouse coordinate
eventData2 is the horizontal mouse coordinate

EVENT_MOUSE_MOVE is sent when the mouse moves, regardless of whether a mouse button is down or whether the mouse is over the control for which you enable extended mouse events. You can specify the minimum interval between mouse move events.

| Note You can call this function repeatedly to change the interval of a control's extended mouse events.

## Parameters

Input
Name | Type | Description
panel | integer | The specifier for a particular panel that is currently in memory. This handle will have been returned by the LoadPanel, NewPanel, or DuplicatePanel function.
ctrl | integer | Pass the ID of the control whose callback function will receive extended mouse events. The ID is the defined constant (located in the UIR header file) which was assigned to the control in the User Interface Editor, or the ID returned by the NewCtrl or DuplicateCtrl function.
minimumEventInterval | double | This parameter specifies the minimum interval (in seconds) between extended mouse events of the same type. If you set this parameter to 0.0, then you receive mouse events as frequently as possible. For example, if the minimum interval were 2 seconds, then you could receive at most one EVENT_MOUSE_MOVE, one EVENT_LEFT_MOUSE_UP, and one EVENT_RIGHT_MOUSE_UP every 2 seconds.

## Return Value

Name | Type | Description
status | integer | Returns zero if the extended mouse events were enabled for the control, or a negative error code if the function failed. The possible negative error codes are:
–1 to –999 | A User Interface Library error code. (Constants are available in userint.h.)
A description of any of these error codes can be obtained using the GetGeneralErrorString function in the toolbox.fp instrument driver.