VB中如何捕捉到鼠标光标形状的改变? 20
需要以下功能程序运行的时候,因程序设置在不同部位鼠标形状会发生不同的改变(源程序中,me.mousepointer=0,即采用默设值,形状由对象决定)。现在希望在运行中监...
需要以下功能
程序运行的时候,因程序设置在不同部位鼠标形状会发生不同的改变(源程序中,me.mousepointer=0,即采用默设值,形状由对象决定)。
现在希望在运行中监测到鼠标光标形状的每次改变,应该怎么做?
最好附源码。 展开
程序运行的时候,因程序设置在不同部位鼠标形状会发生不同的改变(源程序中,me.mousepointer=0,即采用默设值,形状由对象决定)。
现在希望在运行中监测到鼠标光标形状的每次改变,应该怎么做?
最好附源码。 展开
1个回答
展开全部
Private Declare Function GetCursor Lib "user32" () As Long
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 Sub Command1_Click()
Dim x As Long
Dim h As Long
x = GetCursor
h = CopyIcon(x)
DrawIcon Me.hdc, 10, 10, h
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Call Command1_Click
End Sub
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 Sub Command1_Click()
Dim x As Long
Dim h As Long
x = GetCursor
h = CopyIcon(x)
DrawIcon Me.hdc, 10, 10, h
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Call Command1_Click
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询