Private Declare Function ClipCursor _ Lib "user32" (lpRect As Any) As Long Private Declare Function DestroyCursor _ Lib "user32" (ByVal hCursor As Any) As Long Private Declare Function LoadCursorFromFile _ Lib "user32" Alias "LoadCursorFromFileA" _ (ByVal lpFileName As String) As Long Private Declare Function SetClassLong _ Lib "user32" Alias "SetClassLongA" _ (ByVal hwnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Private Declare Function GetClassLong _ Lib "user32" Alias "GetClassLongA" _ (ByVal hwnd As Long, _ ByVal nIndex As Long) As Long Private Const GCL_HCURSOR = -12 Dim lResult As Long Dim mhAniCursor As Long Dim mhAniCursor2 As Long Dim mhBaseCursor As Long Private Sub Form_Load() mhBaseCursor = GetClassLong((hwnd), GCL_HCURSOR) End Sub 'установка ani-курсора на форму Private Sub Command1_Click() mhAniCursor = LoadCursorFromFile("C:\windows\cursors\hourglas.ani") lResult = SetClassLong((hwnd), GCL_HCURSOR, mhAniCursor) MsgBox "А теперь наведите курсор на форму." End Sub 'удаление ani-курсора Private Sub Command2_Click() lResult = SetClassLong((hwnd), GCL_HCURSOR, mhBaseCursor) lResult = DestroyCursor(mhAniCursor) End Sub 'удаление ani-курсора Private Sub Form_Unload(Cancel As Integer) lResult = SetClassLong((hwnd), GCL_HCURSOR, mhBaseCursor) lResult = DestroyCursor(mhAniCursor) End Sub |
На форме разместите два элемента CommandButton. Для Поисковиков: Исходники на Бейсике; Программа на Бейсике; Курсор; Анимированный курсор; Исходники; |