Äåêëàðèðóåì:
Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Îáðàùåíèå ê ôóíêöèè:
strPathToCursor - ïóòü ê ôàéëó ñ âàøèì êóðñîðîì ico èëè cur
Public Function SetMyCirsor(strPathToCursor As String)
Dim lngCursor As Long
lngCursor = LoadCursorFromFile(strPathToCursor)
lngCursor = SetCursor(lngCursor)
End Function
Ìîæíî íàïðèìåð âûçâàòü ôóíêöèþ Function SetMyCirsor èç ñîáûòèÿ MouseMove.
Private Sub MyButton_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
SetMyCursor "c:\MyCursor.cur"
End Sub