Condividi tramite


CStatusBarCtrl::GetText

Recupera il testo da parte specifica di un controllo barra di stato.

CString GetText( 
   int nPane, 
   int* pType = NULL 
) const; 
int GetText( 
   LPCTSTR lpszText, 
   int nPane, 
   int* pType = NULL  
) const;

Parametri

  • lpszText
    Indirizzo del buffer che riceve il testo. Questo parametro è una stringa con terminazione null.

  • nPane
    Indice a base zero della parte da cui recuperare testo.

  • pType
    Puntatore a un intero che riceve informazioni sul tipo. Il tipo può essere uno dei valori seguenti:

    • 0 Il testo viene disegnato con un bordo per visualizzare più basso del piano della barra di stato.

    • SBT_NOBORDERS il testo viene tracciato senza bordi.

    • SBT_POPOUT il testo viene disegnato con un bordo per visualizzare il primo piano della barra di stato.

    • SBT_OWNERDRAW se il testo del tipo di disegno SBT_OWNERDRAW, pType riceve il messaggio e restituisce il valore a 32 bit associato al testo anziché la lunghezza e il tipo di operazione.

Valore restituito

La lunghezza, i caratteri, del testo o CString che contiene il testo corrente.

Esempio

int nType;
TCHAR* pszPaneOneText;

pszPaneOneText = new TCHAR[ m_wndSBC.GetTextLength(1, &nType) + 1 ];
int nTextLength = m_wndSBC.GetText(pszPaneOneText, 1, &nType);

switch(nType)
{
   case 0:
      // Text is drawn with a border to appear lower than the  
      // plane of the status bar 
      break;
   case SBT_NOBORDERS:
      // text is drawn without borders 
      break;
   case SBT_OWNERDRAW:
      // Text is drawn by the parent window 
      break;
   case SBT_POPOUT:
      // Text is drawn with a border to appear higher than the  
      // plane of the status bar 
      break;
}   

delete pszPaneOneText;

Requisiti

Header: afxcmn.h

Vedere anche

Riferimenti

Classe CStatusBarCtrl

Grafico delle gerarchie

CStatusBarCtrl::SetText

CStatusBarCtrl::GetTextLength