XE2下PtInRect怎么使用?
POINT pt;
GetCursorPos(&pt);//得到鼠标的坐标
RECT rect;
GetWindowRect(Handle,&rect);//得到窗体的矩形范围
if(
PtInRect(rect,pt)
){}
在XE下编译正常,在XE2下不能编译,提示:
[BCC32 Error] Unit1.cpp(152): E2015 Ambiguity between '_fastcall System::Types::PtInRect(const System::Types::TRectF &,const System::Types::TPointF &) at c:\program files\embarcadero\rad studio\9.0\include\windows\rtl\System.Types.hpp:1124' and '_fastcall System::Types::PtInRect(const System::Types::TRect &,const System::Types::TPoint &) at c:\program files\embarcadero\rad studio\9.0\include\windows\rtl\System.Types.hpp:1123' Full parser context
POINT pt;GetCursorPos(&pt);//得到鼠标的坐标TRect rect;GetWindowRect(Handle,&rect);//得到窗体的矩形范围if (PtInRect(rect,pt)){}