关于GetWindowRect
如下:
CRect rect;
GetDlgItem(IDC_STATIC_Par)->GetWindowRect(rect);
GetDlgItem(IDC_STATIC_Par)->GetWindowRect(&rect);
这两句好像产生一样的效果,都是得到了控件IDC_STATIC_Par的位置和尺寸,
难道&在这个地方有没有都一样?
如下:
CRect rect;
GetDlgItem(IDC_STATIC_Par)->GetWindowRect(rect);
GetDlgItem(IDC_STATIC_Par)->GetWindowRect(&rect);
这两句好像产生一样的效果,都是得到了控件IDC_STATIC_Par的位置和尺寸,
难道&在这个地方有没有都一样?
CRect 是类,其中包含自动转换机制,
定义部分有:
// convert between CRect and LPRECT/LPCRECT (no need for &)
operator LPRECT();
operator LPCRECT() const;
现实部分有:
_AFXWIN_INLINE CRect::operator LPRECT()
{ return this; }
_AFXWIN_INLINE CRect::operator LPCRECT() const
{ return this; }