CRect m_rectClient; m_btnXXX.GetClientRect(m_rectClient);//then you retrieve the client coordinate if you want to get the screen coordinate,you could call function; m_btnXXX.GetWindowRect(m_rectClient);//the coordinate you get will base on screen coordinate which use the screen Left-Top point as its (0,0) point!
CRect m_rectClient; m_btnXXX.GetClientRect(m_rectClient);//then you retrieve the client coordinate if you want to get the screen coordinate,you could call function; m_btnXXX.GetWindowRect(m_rectClient);//the coordinate you get will base on screen coordinate which use the screen Left-Top point as its (0,0) point!
m_btnXXX.GetClientRect(m_rectClient);//then you retrieve the client coordinate
if you want to get the screen coordinate,you could call function;
m_btnXXX.GetWindowRect(m_rectClient);//the coordinate you get will base on
screen coordinate which use the screen Left-Top point as its (0,0) point!
m_btnXXX.GetClientRect(m_rectClient);//then you retrieve the client coordinate
if you want to get the screen coordinate,you could call function;
m_btnXXX.GetWindowRect(m_rectClient);//the coordinate you get will base on
screen coordinate which use the screen Left-Top point as its (0,0) point!
CRect rect;
GetDlgItem(IDC_BUTTON1)->GetWindowRect(&rect);
::GetWindowRect(::GetDlgItem(GetSafeHwnd(),IDC_BUTTON1),&rect);
凡是CWnd的,都可以GetWindowRect();
得到的Rect是相对Screen的。
CWnd还提供ScreenToClient()和ClientToScreen()用来转换坐标。。