Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function CreateDCA& Lib "gdi32" (ByVal lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As String, lpInitData As Long)
Private Sub form_load()
Dim a As String
a = CreateDCA("DISPLAY", vbNullString, vbNullString, 0)
Do While GetPixel(a, 24, 54) <> 421400000#
SendKeys "F"
Loop
End Sub
Private Sub form_KeyPress(KeyAscii As Integer)
If KeyAscii = 122 Then unload me
End Sub
用VB写的一段判断颜色的代码,用于外挂编程,很有用。以前编写的外挂到现在都能用,从来没被封过。