Important: The information in this document is obsolete and should not be used for new development.
InitCursorCtl
To load the resources necessary for displaying an animated cursor, use theInitCursorCtl
procedure.
PROCEDURE InitCursorCtl (newCursors: UNIV acurHandle);
newCursors
A handle to anAcur
record (described on page 8-18) that specifies the cursor resources you want to use in your animation. If you specifyNIL
in this parameter,InitCursorCtl
loads the animated cursor resource (described on page 8-33) with resource ID 0--as well as the cursor resources (described on page 8-31) specified therein--from your application's resource file.DESCRIPTION
TheInitCursorCtl
procedure loads the cursor resources for an animated cursor sequence into memory. Your application should call theInitCursorCtl
procedure once prior to calling theRotateCursor
procedure (described on page 8-30) or theSpinCursor
procedure (described on page 8-30).If your application passes
NIL
in thenewCursors
parameter,InitCursorCtl
loads the'acur'
resource with resource ID 0, as well as the'CURS'
resources whose resource IDs are specified in the'acur'
resource. If any of the resources cannot be loaded, the cursor does not change when you callRotateCursor
orSpinCursor
. Otherwise, theRotateCursor
procedure and theSpinCursor
procedure display in sequence the cursors specified in these resources.If your application does not pass
NIL
in thenewCursors
parameter, it must pass a handle to anAcur
record. Your application can use the Resource Manager functionGetResource
to obtain a handle to an'acur'
resource, which your application should then coerce to a handle of typeacurHandle
when passing it toInitCursorCtl
.If your application calls the
RotateCursor
orSpinCursor
procedure without callingInitCursorCtl
,RotateCursor
andSpinCursor
automatically callInitCursorCtl
. However, since you won't know the state of memory, any memory allocated by the Resource Manager for animating cursors may load into an undesirable location, possibly causing fragmentation. Calling theInitCursorCtl
procedure during your initialization process has the advantage of causing the memory allocation when you can control its location. For information on using theInitCursorCtl
procedure during your initialization process, see "Initializing the Cursor" on page 8-6.SPECIAL CONSIDERATION
If you want to use multiple'acur'
resources repeatedly during the execution of your application, be aware that theInitCursorCtl
procedure changes eachframeN
andfillN
integer pair within theAcur
record in memory to a handle to the corresponding'CURS'
resource, which is also in memory. Thus, if thenewCursors
parameter is notNIL
when your application calls theInitCursorCtl
procedure, your application must guarantee thatnewCursors
always points to a fresh copy of an'acur'
resource.SEE ALSO
Listing 8-1 on page 8-6 illustrates how to initialize an animated cursor by using theInitCursorCtl
procedure. Listing 8-3 on page 8-13 shows how to animate the cursor with theRotateCursor
procedure, and Listing 8-4 on page 8-13 shows how to animate the cursor with theSpinCursor
procedure.