Say I create a polygon with the Polygon
function, and i'd like it to accept input from the mouse (similar to a button).
How would I do that?
EDIT:
Processing the WM_LBUTTONDOWN
and WM_MOUSEMOVE
messages, I'm using this code to check if the mouse is in the area of the polygon:
if (LOWORD(lParam) < 375 && LOWORD(lParam) > 340 &&
HIWORD(lParam) < 200 && HIWORD(lParam) > 90)
Problem is, the polygon is not a rectangle, its a polygon. So how would I go about detecting if the mouse was in the polygon only?
EDIT 2: I should also note, its only a triangle lol. Hope that makes this simpler.