Home > database >  How does the lParam parameter within NMLISTVIEW get set?
How does the lParam parameter within NMLISTVIEW get set?

Time:11-09

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?

CodePudding user response:

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.

CodePudding user response:

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

  • Related