Condividi tramite


CWnd::CalcWindowRect

Calcola il rettangolo della finestra che può contenere un rettangolo client specificato.

virtual void CalcWindowRect(
   LPRECT lpClientRect,
   UINT nAdjustType = adjustBorder 
);

Parametri

  • [in, out] lpClientRect
    Puntatore a una struttura del rettangolo. In input, questa struttura contiene il rettangolo client. Dopo il metodo termina, questa struttura contiene il rettangolo della finestra che può contenere un rettangolo client specificato.

  • [in] nAdjustType
    Utilizzo CWnd::adjustBorder calcolare le coordinate della finestra senza lo stile WS_EX_CLIENTEDGE ; in caso contrario, utilizzare CWnd::adjustOutside.

Note

Le dimensioni del rettangolo calcolato finestra non include lo spazio per una barra dei menu.

Per ulteriori restrizioni dell'utilizzo, vedere AdjustWindowRectEx.

Esempio

// Uses CalcWindowRect to determine size for new CFrameWnd 
// based on the size of the current view. The end result is a 
// top level frame window of the same size as CMdiView's frame. 
void CMdiView::OnMyCreateFrame() 
{
   CFrameWnd* pFrameWnd = new CFrameWnd;
   CRect myRect;
   GetClientRect(myRect);
   pFrameWnd->Create(NULL, _T("My Frame"));
   pFrameWnd->CalcWindowRect(&myRect, CWnd::adjustBorder);
   pFrameWnd->MoveWindow(0, 0, myRect.Width(), myRect.Height());
   pFrameWnd->ShowWindow(SW_SHOW);
}

Requisiti

intestazione: afxwin.h

Vedere anche

Riferimenti

Classe CWnd

Grafico delle gerarchie

AdjustWindowRectEx