1)BOOL GetTextExtentPoint32( HDC hdc, // handle to DC LPCTSTR lpString, // text string int cbString, // characters in string LPSIZE lpSize // string size );2) BOOL PtInRect( CONST RECT *lprc, // rectangle POINT pt // point ); or BOOL PtInRegion( HRGN hrgn, // handle to region int X, // x-coordinate of point int Y // y-coordinate of point );
看了MSDN。。BOOL GetTextExtentPoint32( HDC hdc, // handle to DC LPCTSTR lpString, // text string int cbString, // characters in string LPSIZE lpSize // string size );这个只能获得他的宽度。而不能获得CRect坐标
HDC hdc, // handle to DC
LPCTSTR lpString, // text string
int cbString, // characters in string
LPSIZE lpSize // string size
);2)
BOOL PtInRect(
CONST RECT *lprc, // rectangle
POINT pt // point
);
or
BOOL PtInRegion(
HRGN hrgn, // handle to region
int X, // x-coordinate of point
int Y // y-coordinate of point
);
看了MSDN。。BOOL GetTextExtentPoint32(
HDC hdc, // handle to DC
LPCTSTR lpString, // text string
int cbString, // characters in string
LPSIZE lpSize // string size
);这个只能获得他的宽度。而不能获得CRect坐标