Careful reading of the SDK:
Code:
ListView_SetItemState( HWND hwnd, int i, UINT state, UINT mask );
i
Index of the list-view item. If this parameter is -1, then the state change is applied to all items.
state
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.
mask
So:
Bits of the state parameter that you want to set or clear. You can use ListView_SetItemState both to set and to clear bits.
Code:
ListView_SetItemState(hList, -1, 0, %LVIS_SELECTED) ListView_SetItemState(hList, hItem, %LVIS_SELECTED, %LVIS_SELECTED) ListView_EnsureVisible(hList, hItem, %FALSE)
Leave a comment: