#keywords {{{#!gcode // header RECT prevClientRect; // OnInitDialog ... GetWindowRect(&prevClientRect); ScreenToClient(&prevClientRect); ... // void CLogDialog::OnSizing(UINT fwSide, LPRECT pRect) { CDialogEx::OnSizing(fwSide, pRect); RECT rect = *pRect; ScreenToClient(&rect); CString str; //if (prevClientRect.top != 0) { int diffBottom = rect.bottom - prevClientRect.bottom; int diffTop = rect.top - prevClientRect.top; int diffLeft = rect.left - prevClientRect.left; int diffRight = rect.right - prevClientRect.right; CRect childWndRect; // IDOK GetDlgItem(IDOK)->GetWindowRect(&childWndRect); ScreenToClient(&childWndRect); childWndRect.bottom += diffBottom; childWndRect.top += diffBottom; childWndRect.left += diffRight; childWndRect.right += diffRight; GetDlgItem(IDOK)->MoveWindow(childWndRect.left, childWndRect.top, childWndRect.Width(), childWndRect.Height()); GetDlgItem(IDOK)->RedrawWindow(); // Log List m_listLog.GetWindowRect(&childWndRect); ScreenToClient(&childWndRect); childWndRect.bottom += diffBottom; childWndRect.top += diffTop; childWndRect.left += diffLeft; childWndRect.right += diffRight; m_listLog.MoveWindow(childWndRect.left, childWndRect.top, childWndRect.Width(), childWndRect.Height()); m_listLog.RedrawWindow(); // Line GetDlgItem(IDC_STATIC_LINE)->GetWindowRect(&childWndRect); ScreenToClient(&childWndRect); childWndRect.bottom += diffBottom; childWndRect.top += diffBottom; childWndRect.left += diffLeft; childWndRect.right += diffRight; GetDlgItem(IDC_STATIC_LINE)->MoveWindow(childWndRect.left, childWndRect.top, childWndRect.Width(), childWndRect.Height()); GetDlgItem(IDC_STATIC_LINE)->RedrawWindow(); } prevClientRect = rect; } }}} ---- {{{ }}}