Help - Search - Members - Calendar
Full Version: VB App Question
AC Tools Everything Macro > General Discussion > C++/Delphi/VB Development
Mythos
Hello all,

Was just wondering if anyone knew of a way to target a set of coords on the screen and check thier color using VB?

I will be researching this as well, but thought I would throw a line out here and see if i got any nibbles smile.gif

Mythos
nevermind smile.gif I did some playing around heh

CODE

Option Explicit

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

Sub PixelColor()

 Dim myHwnd As Long
 Dim myDC As Long
 Dim myPixel As Long

 myDC = GetDC(myHwnd)
 myPixel = GetPixel(myDC,10,10)
 MsgBox("Pixel Color = "&myPixel)
 Call ReleaseDC(myHwnd, myDC)

End Sub
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.