在VB中显示动画鼠标图标

2008-02-23 06:53:43来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

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)

上一篇: VB调用IMAGE控件实现图像缩放的一种方法
下一篇: VB随机图像的魅力

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:为VB窗口增添平铺贴图背景

下一篇:将图片「非重叠显示」填满整个表格视窗