自动抓取屏幕的颜色和坐标…… Private Sub Timer1_Timer() Dim hdc As Long Dim a As POINTAPI Dim quyanse As Long Call GetCursorPos(a) '取得鼠标位置 Text1.Text = a.x Text3.Text = a.y hdc = GetDC(0) '取得整个屏幕的hDC Form1.BackColor = GetPixel(hdc, a.x, a.y) '取 颜色 ReleaseDC 0, hd
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long) Private Declare Function GetCursorPos Lib "user32" (lpPoint As pointapi) As Long Private Decl