2010-11-28 12 views

答えて

2

あり、それには、正確な1対1の交換機能はませんが、AdjustWindowRectExはかなり近いです。 CWnd::adjustOutsideフラグを使用してスクロールバーを考慮する場合は、自分で調整する必要があります。例えば

// MFC version 
RECT desiredClientRect = {0, 0, 640, 480}; 
myCwnd->CalcWindowRect(&desiredClientRect, 
    ignoreScrollBars ? CWnd::adjustBorder : CWnd::adjustOutside); 

// Win32 version 
RECT desiredClientRect = {0, 0, 640, 480}; 
DWORD dwStyle = GetWindowLong(myHwnd, GWL_STYLE); 
AdjustWindowRectEx(&desiredClientRect, 
    dwStyle, 
    (GetMenu(myHwnd) != NULL),   // bMenu 
    GetWindowLong(myHwnd, GWL_EXSTYLE)); // dwExStyle 
if(!ignoreScrollBars) 
{ 
    if(dwStyle & WS_HSCROLL) 
     desiredClientRect.right += GetSystemMetrics(SM_CXHSCROLL); 
    if(dwStyle & WS_VSCROLL) 
     desiredClientRect.bottom += GetSystemMetrics(SM_CXVSCROLL); 
} 
関連する問題