2个回答
展开全部
相当简哦,我做一下代码给你。
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Form_Load()
Timer1.Interval = 100
End Sub
Private Sub Timer1_Timer()
Dim pt As POINTAPI
GetCursorPos pt
Label1.BackColor = GetPixel(GetDC(0), pt.x, pt.y)
Text1.Text = Hex(Label1.BackColor)
Label2.Caption = pt.x & " , " & pt.y
End Sub
更多追问追答
追问
麻烦了…我二级能过,这个也还做不出来。。。
追答
有点问题,稍等哦。
说具体一点吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询