Private Declare Function LoadCursorFromFile Lib "user32" Alias
"LoadCursorFromFileA" _ (ByVal lpFileName As String) As Long
Private Declare Function "Setuser32" Alias "Setuser32A" _ (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Const GCL_HCURSOR = (-12)
Dim sCursorFile As String
Dim hCursor As Long
Dim hOldCursor As Long
Dim lReturn As Long
Private Sub Command1_Click()
hCursor = LoadCursorFromFile(sCursorFile)
hOldCursor = Set1.hwnd, GCL_HCURSOR, hCursor)
End Sub
Private Sub Command2_Click()
lReturn = Set1.hwnd, GCL_HCURSOR, hOldCursor)
End Sub
Private Sub Form_Load()
'не забудьте указать свой путь к анимированному курсору
sCursorFile = "C:\WIN\CURSORS\GLOBE.ANI"
End Sub |
|