LoadCursor Function

Purpose

Creates a MouseCursor object based on data contained in a file. The file is specified by its name and containing cursor data in either cursor (.CUR) or animated cursor (.ANI) format.

Syntax

Set mc = LoadCursor(file$)

mc:MouseCursor object
file$sexp

Description

LoadCursor loads a cursor file either from disk or from the ':Files' section. The return value is a MouseCursor object that can be assigned to MouseCursor properties of Ocx objects (for instance Form.MouseCursor). The MouseCursor object is activated when the MousePointer property of the Ocx object is set to basCursor (98).

Example

OpenW 1

Local mc As MouseCursor

If Exist(WinDir & "\Cursors\hourglas.ani") // Only included up to WinXP

Set mc = LoadCursor(WinDir & "\Cursors\hourglas.Ani")

Else

Set mc = LoadCursor(WinDir & "\Cursors\aero_busy.ani")

EndIf

Set Win_1.MouseCursor = mc

Win_1.MousePointer = 98     // basCursor

Do

Sleep

Until IsNothing(Me)

Set mc = Nothing

Remarks

Since GFA-BASIC 32 uses the LoadCursor as a reserved name, the API function LoadCursor() has been renamed to LoadResCursor or apiLoadCursor.

See Also

MouseCursor

{Created by Sjouke Hamstra; Last updated: 12/10/2014 by James Gaite}