Thread: Pixels values
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
BrianB BrianB is offline
external usenet poster
 
Posts: 1
Default Pixels values

You will not get this directly from normal VBA - or even Visual Basic, I
guess. However you may be successful using API functions via VBA.

Have a look at this for starters. A very useful site. :-
http://www.mentalis.org/apilist/GetPixel.shtml

Here is some code which tells you what the current mouse position is
(of course it depends on where the button is to run it.<<grin). This
may save you having to check a few million pixels one by one.

'-----------------------------
'- Get mouse co-ordinates
Type POINTAPI
x As Long
y As Long
End Type
Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As
Long
Dim z As POINTAPI
'------------------------------
Sub Mouse_XY()
GetCursorPos z
MsgBox ("Mouse X : " & z.x & vbCr & "Mouse Y : " & z.y)
End Sub
'------------------------------------------------------
'


---
Message posted from http://www.ExcelForum.com/