please dont rip this site
Prev Next

ListView_SetItemState info  Overview  Group

The ListView_SetItemState macro changes the state of an item in a list view control. You can use this macro or explicitly send the LVM_SETITEMSTATE message.

An itemís state value includes a set of bit flags that indicate the itemís state. The state value can also include image list indexes that indicate the itemís state image and overlay image.

BOOL WINAPI ListView_SetItemState(

    HWND hwnd,

    int i,

    UINT state,

    UINT mask



Handle to the list view control.
Index of the list view item.
Specifies the new state bits for the item. The mask parameter indicates the valid bits of the state parameter. The macro ignores bits in the state parameter if the corresponding bit is not set in the mask parameter.

The low-order byte contains a set of bit flags that indicate the itemís state. This byte can be a combination of the following values.




The item is marked for a cut and paste operation.


The item is highlighted as a drag-and-drop target.


The item has the focus, so it is surrounded by a standard focus rectangle. Although more than one item may be selected, only one item can have the focus.


The item is selected. The appearance of a selected item depends on whether it has the focus, and on the system colors used for selection.

Bits 8 through 11 of the state parameter specify the one-based index of an overlay image in the controlís image lists. Both the full-sized icon image list and the small icon image list can have overlay images. The overlay image is superimposed over the itemís icon image. If these bits are zero, the item has no overlay image. To isolate these bits, use the LVIS_OVERLAYMASK mask. To specify an overlay index, use the INDEXTOOVERLAYMASK macro.

Bits 12 through 15 of the state parameter specify the one-based index of an image in the controlís state image list. The state image is displayed next to an itemís icon to indicate an application-defined state. If these bits are zero, the item has no state image. To isolate these bits, use the LVIS_STATEIMAGEMASK mask. To specify a state image index, use the INDEXTOSTATEIMAGEMASK macro.

Specifies the bits of the state parameter that you want to set. To set an itemís overlay image index, set the LVIS_OVERLAYMASK bits. To set an itemís state image index, set the LVIS_STATEIMAGEMASK bits.

Return Values

No return value.


The mask parameter specifies the state bits you want to modify, and the state parameter specifies the new value for those bits.

To set a bit in the item's internal state, set it in both the mask and state parameters.

To clear a bit in the item's internal state, set it in the mask parameter and clear it in the state parameter.

To leave a bit unchanged in the item's internal state, clear it in the mask parameter.

See Also



file: /Techref/os/win/api/win32/mac/src/mac02_13.htm, 5KB, , updated: 2009/6/11 19:22, local time: 2024/5/28 06:38,

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF=""> ListView_SetItemState</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?


Welcome to!


Welcome to!