VB中如何自定义光标
答案:1 悬赏:0 手机版
解决时间 2021-01-30 07:33
- 提问者网友:無理詩人
- 2021-01-29 07:28
VB中如何自定义光标
最佳答案
- 五星知识达人网友:夜风逐马
- 2021-01-29 08:08
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 & "\大自然等待.ani")
SetClassLong Me.hwnd, GCL_HCURSOR, AniCur
End Sub
Private Sub Form_Unload(Cancel As Integer)
DestroyCursor AniCur
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 & "\大自然等待.ani")
SetClassLong Me.hwnd, GCL_HCURSOR, AniCur
End Sub
Private Sub Form_Unload(Cancel As Integer)
DestroyCursor AniCur
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯