If you are using VC6.0. You can set the properties as "Show selection always" in the ListView. And the ListView will be defined by VC6.0 as LVS_SHOWSELALWAYS .
The definition of the CONTROL file in the resource file is as follows:
CONTROL "List2",IDC_LIST_MEMBER,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_EDITLABELS | WS_BORDER | WS_TABSTOP,7,64,514,187
And the selected item is selected. For my program, the default background color is white, the default selected and focused color is blue, and the default selected, but lost focused color is gray (when the user clicks on another control).
Nick dong
source share