[求助]怎么使用releasedc这个东东
Private Type POINTAPI '定义一个坐标变量
x As Long
y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) 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 ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Dim z As POINTAPI
Private Sub Command1_Click()
End
End Sub
Private Sub Timer1_Timer()
Dim a, b, c, d As String
GetCursorPos z '得到坐标
Text1.Text = z.x & "," & z.y
a = GetPixel(GetDC(0), z.x, z.y) '得到当前点的颜色
ReleaseDC 0, GetDC(0)
Text1.Text = "#" + Hex(a)
End Sub
程序基本是这样啦,但不知为啥运行一段时间就会失效,请问一下那个releasedc 应该怎么样用,后面的参数怎么写.