热门文章 | 热门软件| 热门源码 | 热门电影 | 知识库 | 联系我们
软件 源码 教程 影视 健康 招聘
  HTML | JavaScript | ASP | PHP | JSP | NET | VB | VC | VF | Windows | Linux | Mysql | Mssql | Oracle | Struts 
当前位置: 创世纪计算机资源网 -> 文章频道 ->vb 
站内搜索:
如何改变系统指针
作者:佚名 来源:不详 整理日期:2007-4-13

动画在 Windows 底下是 .ani 格式的档案, 要显示此类游标, 首先要利用
LoadCursorFromFile API 载入.ani 档案, 然後利用 SetSystemCursor API 加以显示,


Const OCR_NORMAL = 32512
Const IDC_ARROW = 32512&

Private Declare Function LoadCursorFromFile Lib "user32" Alias _
        "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
Private Declare Function LoadCursor Lib "user32" Alias " LoadCursorA" _
       (ByVal hInstance As Long, lpCursorName As Any) As Long modified
Private Declare Function SetSystemCursor Lib "user32" (ByVal hcur As Long, _
        ByVal id As Long) As Long


Dim hCursor As Long

hCursor = LoadCursorFromFile( 欲显示的 .ani 或 .cur 档案名称 )
Call SetSystemCursor(hCursor, OCR_NORMAL)

若要将鼠标游标还原原状, 则是执行以下叙述:

hCursor = LoadCursor(0&, ByVal IDC_ARROW)
Call SetSystemCursor(hCursor, OCR_NORMAL)

相关文章