# Mouse Routines

Copy

    procedure trackMouseEvent(integer id, integer flags, integer hovertime)

Will send WM_MOUSEHOVER and WM_MOUSELEAVE messages to the window. Could be used for a custom drawn button. Window OS must be Win95b or greater. For more information please see the Win32 documentation.
id - the control id flags - Any combination of the following: TME_CANCEL The caller wants to cancel a prior tracking request. Must include the type of tracking to be cancelled, eg: TME_CANCEL + TME_HOVER.
TME_HOVER The caller wants to receive a WM_MOUSEHOVER message. If the caller requests hover tracking while hover tracking is already active, the hover timer will be reset. This flag is ignored if the mouse pointer is not over the specified window or area.
TME_LEAVE The caller wants a WM_MOUSELEAVE message.
TME_QUERY The function fills in a TRACKMOUSEEVENT structure instead of treating it as a tracking request.
hovertime - Time in milliseconds for mouse to 'hover' over control before WM_MOUSEHOVER message is sent. If HOVER_DEFAULT is used here then Windows will wait for the default hover time before issuing the WM_MOUSEHOVER message.
Copy

    function findMouse()

Retrieves the id of the control that has captured the mouse.
Copy

    procedure captureMouse(integer id)

Captures the mouse for the specified control so that even if the mouse leaves the client area of the control it will still be sent mouse messages.
Copy

    procedure releaseMouse()

Returns control of the mouse to Windows so that all mouse messages are processed normally.