I would like to suggest a better solution for ordering the items when the user clicks on the column header of the listview.
In this new solution, the type of ordering is stored directly into the lParam field of each column in the header. In that way, the user can order the items in cumulative way, and it keeps memory of the last ordering applied, while this is not possible in the current code.
Perhaps it would be interesting to port this trick also in other applications with big use of these kind of lists, like eventvwr, taskmgr, etc.
While working on this, I had also found a bug since the application was not running on commctrl v5 because unregistered classes. InitCommonControlsEx() has to be called with at least ICC_WIN95_CLASSES, that also includes ICC_BAR_CLASSES.