Declare Function PtInRect Lib "user32.dll" (lpRect As RECT, x As Long, y As Long) As Long
lpRect | The rectangle to search inside. |
x | The x-coordinate of the point to determine if it is inside or outside. |
y | The y-coordinate of the point to determine if it is inside or outside. |
'Example of outside/inside the rectangle
Dim r As RECT
x = SetRect(r, 50, 50, 150, 150) '.Left = 50, .Top = 50, .Right = 150, .Bottom = 150
Form1.Print PtInRect(r, 75, 100) 'returns 1 -- it is inside
Form1.Print PtInRect(r, 100, 100) 'returns 0 -- it is outside
Paul Kuliniewicz
E-mail: Borg953@aol.com
All material presented on these pages is Copyright © Paul Kuliniewicz, except for other copyrighted material.
http://members.aol.com/Borg953/api/p.html