LVCurItem - should be used to determine the index of the "current" element. I have put in quotation marks the word "current", since with this concept in relation to the general list, different interpretations may appear. The fact is that to provide an opportunity to work with the general list not only with the help of the mouse (but also the keyboard), the concepts of "selected items" and "item in focus" are different for it. Just as in the VCL, I decided to use the word "current" to mean the "first selected" item in the list. Probably because when the user asks for any actions to be performed with respect to individual list items, it is most often the "selected" items that are meant. The element in focus is primarily used to to be able to move between list items using the arrows on the keyboard, and highlight the desired items by pressing the appropriate keys. (However, there is a special property to get and work with it, see LVFocusItem below).
If the selection contains no elements, LVCurItemreturns the number -1. The same value should be assigned to this property to deselect and bring the list into a state in which there are no selected items in the list. Assigning a non-negative value for a list with multiple selection of elements adds an element with such an index to the set of selected elements, for lists in which only one selected element is allowed, this one element is selected, and then the selection is unselected;
LVFocusItem - the index of the element in the keyboard focus;
LVNextItem(i, attrs) - returns the index of the next element after i, which has the necessary attributes (they can set the search direction, as well as a combination of attributes LVNI_CUT - marked for cutting, LVNI_DROPHILIGHTED - highlighted for "dropping" objects dragged by the mouse on it, LVNI_FOCUSED - is in the input focus, LVNI_SELECTED - dedicated;
LVNextSelected(i) - finds the next selected (after index i, where i can be set to -1 to start the search from the beginning of the list);
LVSelectAll - a method for selecting all items in the list;
LVSelCount - returns the number of selected items in the list (the general property SelLength does the same);
OnLVStateChange - an event that is triggered when the state of the elements changes (the element is selected, in focus, etc.). The event handler is called for each element in which the state changes, or when the state of several elements changes simultaneously - once for the entire group of elements. In order, for example, to perform some actions only when a certain element is selected, the condition should be checked in the handler:
if (OldState and lvisSelect = 0) and (NewState and lvisSelect <> 0) then ...