-1

According to https://learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmlistview lParam is of Type: LPARAM and is a Application-defined value of the item. This member is undefined for notification messages that do not use it.

It does not say how an application can set its user defined lParam value.

You would have thought that as this is a specific Windows message, it would specify if it is a notification messages that do not use it.

So how does the lParam parameter within NMLISTVIEW get set?

Or is it always undefined?

Peter Nimmo
  • 1,045
  • 2
  • 12
  • 25

2 Answers2

0

The NMLISTVIEW::lParam field carries the same value as the specified ListView item's LVITEM::lParam field. That value is set when the item is added to the ListView via the LVM_INSERTITEM message, or updated via the LVM_SETITEM message. The notification delivers the item's lParam to you so that you don't have to query it separately with the LVM_GETITEM message.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
-1

you do not SET the lParam at all, you need to GET it if you process such a notification message. The system sets it.

iwrbc
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 17 '22 at 21:29