|
||||
LoadCursorFromFileCategory: CursorHits: 5856 Rating: (2.24) votes 1280
Rate: 1-star 2-stars 3-stars 4-stars 5-stars
API Explanation
LoadCursorFromFile loads a cursor from a cursor file. The cursor file can contain either a regular cursor (*.cur) or an animated cursor (*.ani). If successful, the function returns a cursor handle to the newly loaded cursor. If unsuccessful, the function returns 0. Parameter Information Declare Function LoadCursorFromFile Lib "user32.dll" Alias _ "LoadCursorFromFileA" (ByVal lpFileName As String) As Long lpFileName The filename of the cursor file to load. This file can either be a *.cur or an *.ani cursor file.
Code
' Load the cursor "C:\\MyProg\\custom.ani" and set it as
' the current cursor for three seconds. Then restore the original cursor as ' the current cursor. Dim hcursor As Long ' receives handle to the loaded cursor Dim holdcursor As Long ' receives handle to the previously in use cursor Dim retval As Long ' throw-away return value hcursor = LoadCursorFromFile("C:\\MyProg\\custom.ani") ' load the animated cursor from the file If hcursor = 0 Then End ' abort program if cursor couldn't be loaded holdcursor = SetCursor(hcursor) ' set the loaded cursor as the current cursor Sleep 3000 ' wait for three seconds retval = SetCursor(holdcursor) ' restore the previous cursor |