$IFNDEF TRUE
$DEFINE True 1
$ENDIF
$IFNDEF FALSE
$DEFINE False 0
$ENDIF
$IFNDEF boolean
$DEFINE boolean INTEGER
$ENDIF
DECLARE FUNCTION LoadCursorFromFile LIB "user32" ALIAS "LoadCursorFromFileA" (CursorFileName AS STRING) AS LONG
DECLARE FUNCTION SetCursorPos LIB "user32" ALIAS "SetCursorPos" (x AS LONG,y AS LONG) AS LONG
DECLARE FUNCTION ShowCursor LIB "user32" ALIAS "ShowCursor" (bShow AS LONG) AS LONG
TYPE QCursor EXTENDS QOBJECT
Private:
FileName AS STRING
Public:
Count AS INTEGER PROPERTY SET SetCount
Visible AS boolean PROPERTY SET SetShow
PROPERTY SET SetCount(count AS INTEGER)
END PROPERTY
PROPERTY SET SetShow(visible AS boolean)
This.Visible=visible
ShowCursor(visible)
END PROPERTY
SUB LoadFromResource(Res AS LONG)
IF Res<RESOURCECOUNT() AND Res>-1 THEN
EXTRACTRESOURCE Resource(Res),This.FileName
This.Count++
Screen.Cursors(This.Count)=LoadCursorFromFile(This.FileName)
IF FILEEXISTS(This.FileName) THEN KILL This.FileName
END IF
END SUB
SUB LoadFromFile(FileName AS STRING)
IF FILEEXISTS(FileName) THEN
This.Count++
Screen.Cursors(This.Count)=LoadCursorFromFile(FileName)
END IF
END SUB
SUB Move(x AS LONG,y AS LONG)
SetCursorPos(x,y)
END SUB
CONSTRUCTOR
Count=0
Visible=true
FileName=LEFT$(COMMAND$(0),rinstr(COMMAND$(0),"\"))+"temp.cur"
END CONSTRUCTOR
END TYPE
|