
Private Declare Function CreateDC& Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As String, lpInitData As Any)
Private Declare Function DeleteDC& Lib "gdi32" (ByVal hdc 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 GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function SetCursorPos Lib "user32.dll" (ByVal x As Long, ByVal y As Long) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Dim z As POINTAPI
' type for storing the cursor positions
Private Type CURPOS
x As Long
y As Long
End Type
Dim xxx As CURPOS
Private Sub Form_Load()
Timer1.Interval = 10
End Sub
Private Sub Timer1_Timer()
GetCursorPos z
screendc = CreateDC("DISPLAY", "", "", 0&)
'Я идиот! Убейте меня, кто-нибудь!??? Я идиот! Убейте меня, кто-нибудь! Text1 = Hex(GetPixel(screendc, z.x, z.y))
'???? ?? Я идиот! Убейте меня, кто-нибудь!? Я идиот! Убейте меня, кто-нибудь!?? Hex-Я идиот! Убейте меня, кто-нибудь!??? Я идиот! Убейте меня, кто-нибудь!
Text1 = GetPixel(screendc, z.x, z.y)
Picture1.BackColor = SetCursorPos(xxx.x, xxx.y)
DeleteDC (screendc)
End Sub
Private Declare Function CreateDC& Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As String, lpInitData As Any)
Private Declare Function DeleteDC& Lib "gdi32" (ByVal hdc 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 GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function SetCursorPos Lib "user32.dll" (ByVal X As Long, ByVal Y As Long) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Dim z As POINTAPI
Private Sub Form_Load()
Timer1.Interval = 10
End Sub
Private Sub Timer1_Timer()
Dim i As Long
GetCursorPos z
screendc = CreateDC("DISPLAY", "", "", 0&)
Text1 = GetPixel(screendc, z.X, z.Y)
If Text1.Text = 255 Then i = SetCursorPos(screendc = z.X, z.Y)
If Text1.Text = 8454143 Then i = SetCursorPos(screendc = z.X, z.Y)
DeleteDC (screendc)
End Sub
______________________________________________
Private Sub Timer1_Timer()
Dim i As Long
GetCursorPos z
screendc = CreateDC("DISPLAY", "", "", 0&)
Text1 = GetPixel(screendc, z.X, z.Y)
If Text1.Text = 255 Then i = SetCursorPos(z.X + 1, z.Y + 1)
If Text1.Text = 8454143 Then i = SetCursorPos(z.X + 1, z.Y + 1)
DeleteDC (screendc)
End Sub
Private Sub Form_Load()
DeskDC = GetWindowDC(GetDesktopWindow)
Clr = 255
End Sub
Private Sub Timer1_Timer()
Call GetCursorPos(Pt)
If GetPixel(DeskDC, Pt.x, Pt.y) <> Clr Then
For i = -10 To 10
For j = -10 To 10
If GetPixel(DeskDC, Pt.x + i, Pt.y + j) = Clr Then
Call SetCursorPos(Pt.x + i, Pt.y + j)
i = 11: j = 11
End If
Next
Next
End If
End Sub
Type POINTAPI
x As Long
y As Long
End Type
Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Declare Function GetDesktopWindow Lib "user32" () As Long
Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Public DeskDC As Long, Pt As POINTAPI, Clr As Long
screendc = CreateDC("DISPLAY", "", "", 0&)
P.S. Вот только я не могу понять кто-ж тебе дал такой странный способ получения DC экрана?
Сейчас этот форум просматривают: AhrefsBot, Bing-бот и гости: 17