void SetClientWindowSize(HWND, int , int)
void SetClientWindowSize(HWND hWnd, int nClientWidth, int nClientHeight)
{
RECT WindowRect,ClientRect;
int nDeltaWidth, nDeltaHeight;
GetWindowRect( hWnd , &WindowRect );
GetClientRect( hWnd , &ClientRect );
nDeltaWidth = ( WindowRect.right - WindowRect.left ) - ( ClientRect.right - ClientRect.left );
nDeltaHeight = ( WindowRect.bottom - WindowRect.top ) - ( ClientRect.bottom - ClientRect.top );
MoveWindow( hWnd , WindowRect.left , WindowRect.top , nWidth + nDeltaWidth , nHeight + nDeltaHeight , TRUE );
}
SetClientWindowSize( hWnd , nWidth , nHeight );
没有评论:
发表评论