Now I am implementing the IShellFolder::CompareIDs function for column
click, because I used the SHCreateShellFolderViewEx to create the view
object, so the detail requirement of the CompareIDs is unknownm, the outline
of the code is listed as follows, but it does not work correctly. For
example, when I click the second column four times, the shell view sort
correctly two times and sort by the first column two times, so it seems to
be a periodic behaviour of four. Why? From the debug trace informatino, I
found when second column is clicked every time, the view object not only
query the second column compare result(lParam = 0x00000001), but also query
the first column(lParam = 0x00000000). My operating system is windows 2000.
IShellDetails::ColumnClick: return S_FALSE;
step1: uColumn = lParam & SHCIDS_COLUMNMASK.
step2: using the IShellFolder2::MapColumnToSCID and
IShellFolder2::GetDetailsEx to get the value of the pidl1 and pidl2. In this
step, a condition of one level id list is assumed, or it will just return
step3: using the VarCmp to compare the value.
IShellFolder2::GetDefaultColumnState: SHCOLSTATE_TYPE_STR |