VB一个全局的获取当前鼠标样式的代码(特征)

我直接说一个全局的获取当前鼠标样式的代码吧


有关的API:

Type   POINTAPI   '代表鼠标指针当前位置的一个结构

        X   As   Long

        Y   As   Long

End   Type


Private   Type   CURSORINFO   '获得鼠标信息内容

cbSize   As   Long       '本结构大小

flags   As   Long         '附加参数

hCursor   As   Long     '获取的鼠标句丙

ptScreenPos   As   POINTAPI   '鼠标当前的坐标

End   Type


Private   Declare   Function   CopyIcon   Lib   "user32 "   (ByVal   hIcon   As   Long)   As   Long

'复制一个鼠标/图标的句丙


Private   Declare   Function   DrawIcon   Lib   "user32 "   (ByVal   hdc   As   Long,   ByVal   X   As   Long,   ByVal   Y   As   Long,   ByVal   hIcon   As   Long)   As   Long

'将鼠标样式画出来


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

'将不用的鼠标句丙释放


Private   Declare   Function   GetCursorInfo   Lib   "user32 "   (pci   As   CURSORINFO)   As   Long

'获取系统内当前鼠标的信息


sub   DrawCursorImage(Hdc   as   long)

dim   CursorPar   as   CURSORINFO

GetCursorInfo   CursorPar   


dim   iCursor   as   long   

iCursor   =   CopyIcon   (CursorPar.hCursor)


DrawIcon   Hdc,10,10,iCursor


DestroyCursor   iCursor


end   sub
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值