I am trying to get the selected column index of the ListView control, but the macro function ListView_GetSelectedColumn
returns ZERO, no matter how I click.
a = ListView_GetSelectedCount(lpNmhdr->hwndFrom);
a = 999;
a = ListView_GetSelectedColumn(lpNmhdr->hwndFrom);
a = SendMessage(lpNmhdr->hwndFrom, LVM_GETSELECTEDCOLUMN, 0, 0);
I can reproduce your issue. But I get it working after the following steps. This is my test result:
To use ListView_GetSelectedColumn, specify Comctl32.dll version 6 in the manifest. Create a manifest and enable your application to use visual styles.
Refer to ListView_GetSelectedColumn macro and Enabling Visual Styles.
Three steps you need to complete: