Hola, con respecto a tu respuesta: sería buscar una cadena dentro de una imágen como tu dices puede ser... quisiera saber si es posible.
Saludos.
Saludos.
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCita de: Hasseds en 19 Septiembre 2011, 04:01 AM
mmm... revisá si esto puede servir, en caso q sirva... te toca optimizar.
Option Explicit
Private Sub Form_Load()
Call SetWindowPos(Me.hwnd, -1, 0, 0, 0, 0, &H2 Or &H1)
AutoRedraw = True
FontBold = True
BackColor = &HAA431B
ForeColor = vbWhite
StartHook
End Sub
Private Sub Form_Unload(Cancel As Integer)
StopHook
End Sub
Option Explicit
Private Declare Function SetWindowsHookEx Lib "user32.dll" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
Private Declare Function UnhookWindowsHookEx Lib "user32.dll" (ByVal hHook As Long) As Long
Private Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal ncode As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags 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.dll" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Private Const WH_MOUSE_LL As Long = 14
Private Type POINTAPI: x As Long: y As Long: End Type
Dim hHook As Long
Dim lDC As Long
Public Sub StartHook()
hHook = SetWindowsHookEx(WH_MOUSE_LL, AddressOf MouseProc, App.hInstance, &H0&)
lDC = GetWindowDC(&H0&)
End Sub
Public Sub StopHook()
Call UnhookWindowsHookEx(hHook)
hHook = &H0&
Call ReleaseDC(&H0&, lDC)
End Sub
Private Function MouseProc(ByVal ncode As Long, ByVal wParam As Long, lParam As POINTAPI) As Long
Dim lColor As Long
lColor = GetPixel(lDC, lParam.x, lParam.y)
'If Not lColor < 0 Then
'Form1.Cls
'Form1.Print Hex(lColor)
If lColor = &HAA431B Then
Form1.Caption = "SI"
Else
Form1.Caption = "NO"
End If
'End If
MouseProc = CallNextHookEx(hHook, ncode, wParam, lParam)
End Function
Dim iX As Integer
Dim iY As Integer
Dim hdc As Long, pxColor As Double
Call GetCursorPos(Mouse)
For iX = Mouse.x To Mouse.x + 100
For iY = Mouse.y To Mouse.y + 75
Call SetCursorPos(iX, iY)
'Hasta acá todo bien, lo que viene ahora es lo que lenta muchísimo mi aplicación...
hdc = GetDC(0)
pxColor = GetPixel(hdc, Mouse.x, Mouse.y)
ReleaseDC 0, hdc
Me.Caption = Hex(pxColor)
If Me.Caption = "AA431B" Then
Exit For
End If
'//
Next iY
Next iX