I'm trying to select an item in a listview from code. However I'm having some problems. Both
Code:
ListView_SetItemState(ListViewHandle, 4, LVIS_SELECTED, LVIS_SELECTED)
and
Code:
SelectListViewItemMessage.state = LVIS_SELECTED;
SelectListViewItemMessage.stateMask = LVIS_SELECTED;
SendMessage(ListViewHandle, LVM_SETITEMSTATE, (int) 4, (LPARAM) &SelectListViewItemMessage);
don't work. However sendmessage does return TRUE.
Mayb it is due to the style of the listview? It has the following style (there is always only 1 item selected never 0 never more than 1):
Code:
WS_CHILD              LVS_REPORT
WS_VISIBLE            LVS_SINGLESEL
WS_VSCROLL            LVS_SHOWSELALWAYS
WS_TABSTOP            LVS_SHAREIMAGELISTS
                      LVS_OWNERDRAWFIXED
                      LVS_NOCOLUMHEADER
ExStyle: 0x0