Mouse Function Summary
Changing the shape of the mouse cursor is the only built-in PowerBASIC function related to controlling the mouse.

Otherwise, responding to mouse events via the CallBack function is the primary approach PowerBASIC programmers use to respond to user mouse actions.

Client Area Messages
These messages are sent to windows when a mouse event (press or release) occurs within the window's client area.

WM_LBUTTONDBLCLK
WM_LBUTTONDOWN
WM_LBUTTONUP
WM_MBUTTONDBLCLK
WM_MBUTTONDOWN
WM_MBUTTONUP
WM_RBUTTONDBLCLK
WM_RBUTTONDOWN
WM_RBUTTONUP

The x/y coordinates of the mouse hot spot are in the low-order/hi-order word, respectively, of lParam.

area. The system posts the WM_MOUSEMOVE message to the window when the user moves the cursor within the client area. WM_CAPTURECHANGED - sent to window losing mouse capture WM_MOUSEACTIVATE - set top-level window as active WM_MOUSEHOVER - hovers over the client area for a certain time period WM_MOUSEHWHEEL - detects movement of mouse wheel WM_MOUSELEAVE - leaves the client area WM_MOUSEMOVE - moves within the client area WM_MOUSEWHEEL - detects movement of mouse wheel WM_NCHITTEST - determines if mouse event was in client/non-client area =============Non-Client Area

Non-Client Area Messages
A window also receives a message when a mouse event occurs in the window, but outside the client area - border, menu bar, title bar, scroll bar, window menu, minimize button, and maximize button.

These non-client messages are generated primarily for use by Windows. There is a corresponding non-client area mouse message for each client area mouse message.

    WM_NCLBUTTONDBLCLK
    WM_NCLBUTTONDOWN
    WM_NCLBUTTONUP
    WM_NCMBUTTONDBLCLK
    WM_NCMBUTTONDOWN
    WM_NCMBUTTONUP
    WM_NCMOUSEHOVER
    WM_NCMOUSELEAVE
    WM_NCMOUSEMOVE
    WM_NCRBUTTONDBLCLK
    WM_NCRBUTTONDOWN
    WM_NCRBUTTONUP

XButton Messages
Windows supports a mouse with 5 buttons. in addition to the left, middle, and right buttons there are XBUTTON1 and XBUTTON2, which provide backward and forward navigation when internet browsers.

These messages are provided:

    WM_XBUTTONDBLCLK		- client area
    WM_XBUTTONDOWN		- client area
    WM_XBUTTONUP		- client area 
    WM_NCXBUTTONDBLCLK		- non-client area
    WM_NCXBUTTONDOWN		- non-client area
    WM_NCXBUTTONUP		- non-client area
The HIWORD of the WPARAM in these messages contains a flag indicating which X button was pressed.

Capturing Mouse Events

Most programmer effort related to mouse control takes place in a Callback Function, responding to mouse events.

Mouse Properties
The properties of a mouse depends on the software drivers supporting the mouse. The Control Panel/Mouse applet is typically used to make changes to the action of the mouse, such as button configurations, pointer options, wheel features and set points.

Function Reference
Here's an example of the MOUSEPTR statement.

If you have any suggestions or corrections, please let me know.