Messages


LVM_GETNEXTITEM Message

Searches for a list-view item that has the specified properties and bears the specified relationship to a specified item. You can send this message explicitly or by using the ListView_GetNextItem macro.

Syntax

To send this message, call the SendMessage function as follows.
To send this message, call the SendMessage function as follows.
lResult = SendMessage(    // returns LRESULT in lResult
   hWndControl,           // (HWND) handle to destination control
   LVM_GETNEXTITEM,       // (UINT) message ID
   wParam,                // = (WPARAM)(int) iStart; 
   lParam                 // = (LPARAM)(UINT) flags;
);

Parameters

iStart
Index of the item to begin the search with, or -1 to find the first item that matches the specified flags. The specified item itself is excluded from the search.
flags
Specifies the relationship to the item specified in iStart. This can be one or a combination of the following values:

Searches by index.
LVNI_ALL
Searches for a subsequent item by index, the default value.
LVNI_PREVIOUS
Microsoft Windows Vista and later: Searches for an item that is ordered before the item specified in plvii. The LVNI_PREVIOUS flag is not directional (LVNI_ABOVE will find the item positioned above, while LVNI_PREVIOUS will find the item ordered before.) The LVNI_PREVIOUS flag basically reverses the logic of the search performed by the LVM_GETNEXTITEM or LVM_GETNEXTITEMINDEX messages.

Searches by physical relationship to the index of the item where the search is to begin.
LVNI_ABOVE
Searches for an item that is above the specified item.
LVNI_BELOW
Searches for an item that is below the specified item.
LVNI_TOLEFT
Searches for an item to the left of the specified item.
LVNI_TORIGHT
Searches for an item to the right of the specified item.
LVNI_DIRECTIONMASK
Microsoft Windows Vista and later: A directional flag mask with value as follows: LVNI_ABOVE | LVNI_BELOW | LVNI_TOLEFT | LVNI_TORIGHT.

The state of the item to find can be specified with one or a combination of the following values:
LVNI_CUT
The item has the LVIS_CUT state flag set.
LVNI_DROPHILITED
The item has the LVIS_DROPHILITED state flag set
LVNI_FOCUSED
The item has the LVIS_FOCUSED state flag set.
LVNI_SELECTED
The item has the LVIS_SELECTED state flag set.
LVNI_STATEMASK
Microsoft Windows Vista and later: A state flag mask with value as follows: LVNI_FOCUSED | LVNI_SELECTED | LVNI_CUT | LVNI_DROPHILITED.

Searches by appearance of items or by group
LVNI_VISIBLEORDER
Microsoft Windows Vista and later: Search the visible order.
LVNI_VISIBLEONLY
Microsoft Windows Vista and later: Search the visible items.
LVNI_SAMEGROUPONLY
Microsoft Windows Vista and later: Search the current group.

If an item does not have all of the specified state flags set, the search continues with the next item.

Return Value

Returns the index of the next item if successful, or -1 otherwise.

Remarks

Note that the following flags, for use only with Windows Vista, are mutually exclusive of any other flags in use: LVNI_VISIBLEONLY, LVNI_SAMEGROUPONLY, LVNI_VISIBLEORDER, LVNI_DIRECTIONMASK, and LVNI_STATEMASK.

Message Information

Headercommctrl.h
Minimum operating systems Windows NT 3.51, Windows 95
Tags :


Page view tracker