_Code de notification LVN LINKCLICK

Avertit une fenêtre parente d’un contrôle List-View qu’un lien a été activé sur un lien. Ce code de notification est envoyé sous la forme d’un message WM _ Notify .

LVN_LINKCLICK
        
    pLinkInfo = (NMLVLINK*) lParam;         

Paramètres

lParam

Pointeur vers une structure NMLVLINK . L’identificateur du groupe contenant le lien se trouve dans le membre iSubItem .

Valeur de retour

Pas de valeur de retour.

Notes

L’exemple suivant montre comment une application peut répondre à ce code de notification dans son gestionnaire de messages WM _ Notify . L’exemple bascule l’État réduit du groupe et définit le texte de lien approprié.

case LVN_LINKCLICK:
{
    NMLVLINK* pLinkInfo = (NMLVLINK*)lParam;
    HWND hList = pLinkInfo->hdr.hwndFrom;
    LVGROUP groupInfo;
    groupInfo.cbSize = sizeof(groupInfo);
    groupInfo.mask = LVGF_TASK;
    int groupIndex = pLinkInfo->iSubItem;
    if (ListView_GetGroupState(hList, groupIndex, LVGS_COLLAPSED))
    {
        ListView_SetGroupState(hList, groupIndex, LVGS_COLLAPSED, 0);
        groupInfo.pszTask = L"Hide";
    }
    else
    {
        ListView_SetGroupState(hList, groupIndex, LVGS_COLLAPSED, LVGS_COLLAPSED);
        groupInfo.pszTask = L"Show";
     }
      ListView_SetGroupInfo(hList, groupIndex, &groupInfo);
      break;
}

Spécifications

Condition requise Valeur
Client minimal pris en charge
Windows [Applications de bureau Vista uniquement]
Serveur minimal pris en charge
Windows Serveur 2008 [ applications de bureau uniquement]
En-tête
Commctrl. h