uLib  User mode C/C++ extended API library for Win32 programmers.

Module Description

Additional listview APIs...

Macros

#define I_NOIMAGE   (I_IMAGECALLBACK-1) /* Oops.. flew past I_IMAGENONE (also -2) */
 

Typedefs

typedef bool(__stdcall * PFLvItemAction) (HWND hList, LPLVITEM pItem, PVOID pCtx)
 

Functions

UINT ListView_ForEach (HWND hLv, PFLvItemAction Action, PVOID pCtx)
 

Macro Definition Documentation

◆ I_NOIMAGE

#define I_NOIMAGE   (I_IMAGECALLBACK-1) /* Oops.. flew past I_IMAGENONE (also -2) */

Definition at line 1547 of file UtilFunc.h.

Typedef Documentation

◆ PFLvItemAction

typedef bool(__stdcall * PFLvItemAction) (HWND hList, LPLVITEM pItem, PVOID pCtx)

PFLvItemAction is the callback used with ListView_ForEach().

The callback recieves an LVITEM with the following filled in:

iItem = Item index, and iSubItem = zero.
pszText contains the item text, and cchTextMax it's length.
lParam contains the item data, if any.
state contains the item's current state.

You may freely use the LVITEM to send updates to the listview, or query and add subitems,
but you may not delete the item from the list, nor add new items, in the callback,
since that would disrupt the enumeration loop.

Note: The buffer for pszText is 256 chars thread-local, not on stack.

Return true to continue enumeration, of false to stop.

Definition at line 1565 of file UtilFunc.h.

Function Documentation

◆ ListView_ForEach()

UINT ListView_ForEach ( HWND  hLv,
PFLvItemAction  Action,
PVOID  pCtx 
)

ListView_ForEach enumerates items in a list view until the callback returns false or the list is exhausted.

Parameters
hLvListView handle.
ActionYour PFLvItemAction callback for the items.
pCtxAnyhing your callback may need.

ListView_ForEach returns the nr of items processed.

Definition at line 1461 of file UserUtil.cpp.