VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 显示动画鼠标图标
发表评论(0)作者:, 平台:, 阅读:15362, 日期:2000-03-12
显示动画鼠标图标

Win95 的动画鼠标为应用程序增色不少,而 VB 则只提供一般的鼠标图标支持。要用VB

显示动画鼠标形状,你可以使用以下方法:

函数声明:

Public Const GCL_HCURSOR = -12

Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long

Declare Function DestroyCursor Lib "user32" (ByVal hCursor As Any) As Long

Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (_

ByVal lpFileName As String) As Long

Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (ByVal hwnd _

As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Declare Function GetClassLong Lib "user32" Alias "GetClassLongA" (ByVal hwnd _

As Long, ByVal nIndex As Long) As Long

使用:

Dim mhBaseCursor As Long, mhAniCursor As Long

Dim lResult As Long

mhAniCursor = LoadCursorFromFile("c:\windows\cursors\appstart.ani")

lResult = SetClassLong((hwnd), GCL_HCURSOR, mhAniCursor)