Below is some sample code taken from https://docs.microsoft.com/en-us/cpp/mfc/reference/clistctrl-class?view=vs-2019. In all examples I have seen it is not checking if NMHDR* is null or not. Can it be null or is it guaranteed not to be null?
void CListCtrlDlg::OnDblClk(NMHDR* pNMHDR, LRESULT* pResult)
{
UNREFERENCED_PARAMETER(pResult);
LPNMITEMACTIVATE pia = (LPNMITEMACTIVATE)pNMHDR;
LVHITTESTINFO lvhti;
// Clear the subitem text the user clicked on.
lvhti.pt = pia->ptAction;
m_myListCtrl.SubItemHitTest(&lvhti);
if (lvhti.flags & LVHT_ONITEMLABEL)
{
m_myListCtrl.SetItemText(lvhti.iItem, lvhti.iSubItem, NULL);
}
}