'************************************************************
'*程序编号∶018
'*功 能∶如何在VB中使用.ani 动画光标文件
'*日 期∶3/24/1999
'************************************************************
Option Explicit
Private Const GCL_HCURSOR& = (-12)
Private Declare Function SetClassLong& Lib "user32" Alias "SetClassLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long)
Private Declare Function LoadCursorFromFile& Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String)Private NewCursor1 As Long
Private OldCursor1 As Long
Private NewCursor2 As Long
Private OldCursor2 As LongPrivate Sub Form_Load()
NewCursor1 = LoadCursorFromFile(App.Path & "\大自然等待.ani")
OldCursor1 = SetClassLong(Me.hWnd, GCL_HCURSOR, NewCursor1)
NewCursor2 = LoadCursorFromFile(App.Path & "\危险动物忙碌.ani")
OldCursor2 = SetClassLong(Picture1.hWnd, GCL_HCURSOR, NewCursor2)
End SubPrivate Sub Form_Unload(Cancel As Integer)
SetClassLong Me.hWnd, GCL_HCURSOR, OldCursor1
SetClassLong Picture1.hWnd, GCL_HCURSOR, OldCursor2
End Sub
'*程序编号∶018
'*功 能∶如何在VB中使用.ani 动画光标文件
'*日 期∶3/24/1999
'************************************************************
Option Explicit
Private Const GCL_HCURSOR& = (-12)
Private Declare Function SetClassLong& Lib "user32" Alias "SetClassLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long)
Private Declare Function LoadCursorFromFile& Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String)Private NewCursor1 As Long
Private OldCursor1 As Long
Private NewCursor2 As Long
Private OldCursor2 As LongPrivate Sub Form_Load()
NewCursor1 = LoadCursorFromFile(App.Path & "\大自然等待.ani")
OldCursor1 = SetClassLong(Me.hWnd, GCL_HCURSOR, NewCursor1)
NewCursor2 = LoadCursorFromFile(App.Path & "\危险动物忙碌.ani")
OldCursor2 = SetClassLong(Picture1.hWnd, GCL_HCURSOR, NewCursor2)
End SubPrivate Sub Form_Unload(Cancel As Integer)
SetClassLong Me.hWnd, GCL_HCURSOR, OldCursor1
SetClassLong Picture1.hWnd, GCL_HCURSOR, OldCursor2
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货