Option ExplicitPrivate 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 Const GCL_HCURSOR = (-12)Dim hCurOld As Long Private Sub cmdRestoreCursor_Click() Dim hCur As Long
hCurOld = SetClassLong(Form1.hwnd, GCL_HCURSOR, hCur) End SubPrivate Sub Form_Load() Dim hCur As Long
hCur = LoadCursorFromFile(app.path+"\metronom.ani") hCurOld = SetClassLong(Form1.hwnd, GCL_HCURSOR, hCur) End Sub
Option Explicit Private Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long Private Declare Function DestroyCursor Lib "user32" (ByVal hCursor As Long) 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 Const GCL_HCURSOR = (-12)Dim AniCur As Long Private Sub Form_Load() AniCur& = LoadCursorFromFile(App.Path & "\Neko.ani") SetClassLong Me.hwnd, GCL_HCURSOR, AniCur End SubPrivate Sub Form_Unload(Cancel As Integer) DestroyCursor AniCur End Sub
Option Explicit '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ' API declare Private Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long Private Declare Function DestroyCursor Lib "user32" (ByVal hCursor As Long) As Long Private Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long ' Const declare Private Const GCL_HCURSOR = (-12) ' Dim AniCur As Long '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Private Sub Form_Load() AniCur& = LoadCursorFromFile(App.Path & "\Neko.ani") SetClassLong Me.hwnd, GCL_HCURSOR, AniCur End SubPrivate Sub Form_Unload(Cancel As Integer) DestroyCursor AniCur End Sub
Option Explicit '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ' API declare Private Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long Private Declare Function DestroyCursor Lib "user32" (ByVal hCursor As Long) As Long Private Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long ' Const declare Private Const GCL_HCURSOR = (-12) ' Dim AniCur As Long '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Private Sub Form_Load() AniCur& = LoadCursorFromFile(App.Path & "\Neko.ani") SetClassLong Me.hwnd, GCL_HCURSOR, AniCur End SubPrivate Sub Form_Unload(Cancel As Integer) DestroyCursor AniCur End Sub
FORM1.MouseIcon = LoadPicture(App.Path + "\XXX.ICO")
怎样调用此类文件??
除非系统是用ani,然后使用系统光标
Private Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Const GCL_HCURSOR = (-12)Dim hCurOld As Long
Private Sub cmdRestoreCursor_Click()
Dim hCur As Long
hCurOld = SetClassLong(Form1.hwnd, GCL_HCURSOR, hCur)
End SubPrivate Sub Form_Load()
Dim hCur As Long
hCur = LoadCursorFromFile(app.path+"\metronom.ani")
hCurOld = SetClassLong(Form1.hwnd, GCL_HCURSOR, hCur)
End Sub
Private Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
Private Declare Function DestroyCursor Lib "user32" (ByVal hCursor As Long) 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 Const GCL_HCURSOR = (-12)Dim AniCur As Long
Private Sub Form_Load()
AniCur& = LoadCursorFromFile(App.Path & "\Neko.ani")
SetClassLong Me.hwnd, GCL_HCURSOR, AniCur
End SubPrivate Sub Form_Unload(Cancel As Integer)
DestroyCursor AniCur
End Sub
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
' API declare
Private Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
Private Declare Function DestroyCursor Lib "user32" (ByVal hCursor As Long) As Long
Private Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
' Const declare
Private Const GCL_HCURSOR = (-12)
'
Dim AniCur As Long
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Private Sub Form_Load()
AniCur& = LoadCursorFromFile(App.Path & "\Neko.ani")
SetClassLong Me.hwnd, GCL_HCURSOR, AniCur
End SubPrivate Sub Form_Unload(Cancel As Integer)
DestroyCursor AniCur
End Sub
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
' API declare
Private Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
Private Declare Function DestroyCursor Lib "user32" (ByVal hCursor As Long) As Long
Private Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
' Const declare
Private Const GCL_HCURSOR = (-12)
'
Dim AniCur As Long
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Private Sub Form_Load()
AniCur& = LoadCursorFromFile(App.Path & "\Neko.ani")
SetClassLong Me.hwnd, GCL_HCURSOR, AniCur
End SubPrivate Sub Form_Unload(Cancel As Integer)
DestroyCursor AniCur
End Sub