// 判断点是否位于矩形内
#define isInRect(x, y, rct) (x >= rct.left && x <= rct.right && y >= rct.top && y <= rct.bottom)
或函数
// 判断点是否位于矩形内
bool isInRect(int x, int y, RECT rct)
{
if (rct.left > rct.right) std::swap(rct.left, rct.right);
if (rct.top > rct.bottom) std::swap(rct.top, rct.bottom);
return x >= rct.left && x <= rct.right && y >= rct.top && y <= rct.bottom;
}