Important: The information in this document is obsolete and should not be used for new development.
Defining Your Own Action Procedures
When a mouse-down event occurs in a control, theTrackControl function responds as appropriate by
highlighting the control or dragging the indicator as long as the user holds down the mouse button. You can define other actions to be performed repeatedly during this interval. To do so, define your own action procedure and point to it in theactionProc parameter of the TrackControl function.
When calling your action procedure for a control part other than an indicator,
TrackControl
passes your action procedure (1) a handle to the control and (2) the control's part code. Your action procedure should then respond as appropriate. For example, if the user is working in a text document and holds down the mouse button while the cursor is in the lower scroll arrow, your application should scroll continuously one line at a time until the user releases the mouse button or reaches the end of
the document.For a control part other than an indicator, you declare an action procedure that takes two parameters: a handle to the control in which the mouse-down event occurred and an integer that represents the part of the control in which the mouse-down event occurred. Such an action procedure is declared as
MyAction
in the following section.If the mouse-down event occurs in an indicator, your action procedure should take no parameters, because the user may move the cursor outside the indicator while dragging it. Such an action procedure, declared here as
MyIndicatorAction
, is described on page 5-110.Because it will be called with either zero or two parameters, according to whether the mouse-down event occurred in an indicator or elsewhere, your action procedure can be defined for only one case or the other. The only way to specify actions in response to all mouse-down events in a control, regardless of whether they're in an indicator, is to define your own control definition function, as described in "Defining Your Own Control Definition Function" beginning on page 5-102.
Subtopics
- MyAction
- MyIndicatorAction