Win95的动画鼠标为应用程序增色不少,而VB则只提供一般的鼠标图标支持。要用VB显示动画鼠标形状,你可以使用以下方法:
函数声明:
PublicConstGCL_HCURSOR=-12
DeclareFunctionClipCursorLib”user32″(lpRectAsAny)AsLong
DeclareFunctionDestroyCursorLib”user32″(ByValhCursorAsAny)AsLong
DeclareFunctionLoadCursorFromFileLib”user32″Alias”LoadCursorFromFileA”(ByVal
lpFileNameAsString)AsLong
DeclareFunctionSetClassLongLib”user32″Alias”SetClassLongA”(ByValhwndAsLong,
ByValnIndexAsLong,ByValdwNewLongAsLong)AsLong
DeclareFunctionGetClassLongLib”user32″Alias”GetClassLongA”(ByValhwndAsLong,
ByValnIndexAsLong)AsLong
使用:
DimmhBaseCursorAsLong,mhAniCursorAsLong
DimlResultAsLong
mhAniCursor=LoadCursorFromFile(“c:\windows\cursors\appstart.ani”)
lResult=SetClassLong((hwnd),GCL_HCURSOR,mhAniCursor)->