RECT r;
SetRect( &r, 20, 80, 150, 90 );
RedrawWindow(&r);
这样可以刷新指定区域了,可是这个坐标不能准确获得。
MSDN上这样说void SetRect(int x1,int y1,int x2,int y2 )x1
Specifies the x-coordinate of the upper-left corner.
y1
Specifies the y-coordinate of the upper-left corner.
x2
Specifies the x-coordinate of the lower-right corner.
y2
Specifies the y-coordinate of the lower-right corner.我这里Static控件左上角坐标是(20,80),长130,高10
按照VC里头显示的控件的坐标刷新,发现该刷新的区域没刷新,不该刷新的区域在刷新(闪烁)。
这个坐标究竟如何确定?难道VC里头现实的坐标不是真实坐标吗?
SetRect( &r, 20, 80, 150, 90 );
RedrawWindow(&r);
这样可以刷新指定区域了,可是这个坐标不能准确获得。
MSDN上这样说void SetRect(int x1,int y1,int x2,int y2 )x1
Specifies the x-coordinate of the upper-left corner.
y1
Specifies the y-coordinate of the upper-left corner.
x2
Specifies the x-coordinate of the lower-right corner.
y2
Specifies the y-coordinate of the lower-right corner.我这里Static控件左上角坐标是(20,80),长130,高10
按照VC里头显示的控件的坐标刷新,发现该刷新的区域没刷新,不该刷新的区域在刷新(闪烁)。
这个坐标究竟如何确定?难道VC里头现实的坐标不是真实坐标吗?
只是这个坐标与预期位置不符,很奇怪。
刷新窗口的目的是解决文本重叠的问题。
if ( pWnd )
{
CRect rc;
pWnd->GetWindowRect( &rc );
ScreenToClient( &rc );
int a=rc.left;
int b=rc.top;
CString left,top;
left.Format(_T("%d"),a);
top.Format(_T("%d"),b);
MessageBox(left,top);
}点击后发现IDC_STATIC起点是(40,180)
而资源文件显示是(20,80)
证明了资源文件中的坐标不是我想要的坐标。这是怎么回事?