Share via


TTM_GETTOOLINFO messaggio

Recupera le informazioni gestite da un controllo descrizione comando su uno strumento.

Parametri

wParam

Deve essere zero.

lParam

Puntatore a una struttura TOOLINFO . Quando si invia il messaggio, i membri hwnd e uId identificano uno strumento e il membro cbSize deve specificare le dimensioni della struttura. Quando si usa questo messaggio per recuperare il testo della descrizione comando, assicurarsi che il membro lpszText della struttura TOOLINFO punti a un buffer valido di dimensioni adquate

Valore restituito

Restituisce TRUE se ha esito positivo o FALSE in caso contrario.

Commenti

Se il controllo della descrizione comando include lo strumento, la struttura TOOLINFO riceve informazioni sullo strumento.

Esempio

Nell'esempio seguente viene riposizionato un controllo descrizione comando.

HRESULT MyToolTipClass::OffsetTooltip(int xOffset, int yOffset)  
{  
    HRESULT hr = S_OK;   
    DWORD   dwError = 0;  
  
    if (NULL != m_hWndToolTip)  
    {  
        TOOLINFO ti = {0};  
  
        ti.cbSize = sizeof(TOOLINFO);  
        ti.hwnd   = m_hWndToolTipOwner;  
  
        // Get the current tooltip definition.          
        if( SendMessage(m_hWndToolTip, TTM_GETTOOLINFO, 0, (LPARAM)&ti))  
        {  
            // Offset the tooltip rectangle as specified.              
            OffsetRect(&ti.rect, xOffset, yOffset);  
  
            // Apply the new rectangle to the tooltip.
            SendMessage(m_hWndToolTip, TTM_NEWTOOLRECT, 0, (LPARAM)&ti);  
        }  
        else  
        {  
            dwError = GetLastError();  
            hr = HRESULT_FROM_WIN32(dwError);  
            MyErrorHandler(hr);
       }  
    }  
    return hr;  
}  

Requisiti

Requisito Valore
Client minimo supportato
Windows Vista [solo app desktop]
Server minimo supportato
Windows Server 2003 [solo app desktop]
Intestazione
Commctrl.h
Nomi Unicode e ANSI
TTM_GETTOOLINFOW (Unicode) e TTM_GETTOOLINFOA (ANSI)