void SetClientRect(HWND hWnd, int nWidth, int nHeight)
{
RECT rtClient;
DWORD Style, ExStyle;
SetRect( &rtClient, 0, 0, nWidth, nHeight );
Style = GetWindowLong( hWnd, GWL_STYLE);
ExStyle = GetWindowLong( hWnd, GWL_EXSTYLE );
AdjustWindowRectEx( &rtClient, Style, GetMenu( hWnd ) != NULL, ExStyle );
if( Style & WS_VSCROLL ) rtClient.right += GetSystemMetrics( SM_CXVSCROLL );
if( Style & WS_HSCROLL ) rtClient.bottom += GetSystemMetrics( SM_CYVSCROLL );
SetWindowPos( hWnd, NULL, 0, 0, rtClient.right - rtClient.left, rtClient.bottom - rtClient.top, SWP_NOMOVE SWP_NOZORDER);
}
{
RECT rtClient;
DWORD Style, ExStyle;
SetRect( &rtClient, 0, 0, nWidth, nHeight );
Style = GetWindowLong( hWnd, GWL_STYLE);
ExStyle = GetWindowLong( hWnd, GWL_EXSTYLE );
AdjustWindowRectEx( &rtClient, Style, GetMenu( hWnd ) != NULL, ExStyle );
if( Style & WS_VSCROLL ) rtClient.right += GetSystemMetrics( SM_CXVSCROLL );
if( Style & WS_HSCROLL ) rtClient.bottom += GetSystemMetrics( SM_CYVSCROLL );
SetWindowPos( hWnd, NULL, 0, 0, rtClient.right - rtClient.left, rtClient.bottom - rtClient.top, SWP_NOMOVE SWP_NOZORDER);
}
덧글을 달아 주세요