在CStrollView的派生类CMyScrollView中,
CRect rectClient;
GetClientRect(&rectClient); //得到客户区的rect,但不包含滚动条的区域
DWORD dwStyle = this->GetStyle();
if(dwStyle & WS_VSCROLL) //存在竖滚动条
{
//GetSystemMetrics(SM_CXVSCROLL) 是竖滚动条的宽度(17)
rectClient.right += GetSystemMetrics(SM_CXVSCROLL);
}
if(dwStyle & WS_HSCROLL) //存在横滚动条
{
//GetSystemMetrics(SM_CYHSCROLL) 是横滚动条的宽度(17)
rectClient.bottom += GetSystemMetrics(SM_CYHSCROLL);
}