+ const int iItem = nmLV->iItem;
+
+
+ // FreeAllInternalData will cause LVN_ITEMCHANG* messages, which can be
+ // ignored for efficiency. It is done here because the internal data is in the
+ // process of being deleted so we don't want to try and access it below.
+ if ( m_ignoreChangeMessages &&
+ ( (nmLV->hdr.code == LVN_ITEMCHANGED) || (nmLV->hdr.code == LVN_ITEMCHANGING)))
+ {
+ return TRUE;
+ }
+
+
+ // If we have a valid item then check if there is a data value
+ // associated with it and put it in the event.
+ if ( iItem >= 0 && iItem < GetItemCount() )
+ {
+ wxListItemInternalData *internaldata =
+ wxGetInternalData(GetHwnd(), iItem);
+
+ if ( internaldata )
+ event.m_item.m_data = internaldata->lParam;
+ }
+