For Windows Explorer Abc_1_def is to be queued to abc_10_def front of the
And the general sort of rules, all right, _10_ to the front.
Therefore, in order to use the habit, it is best to use the collation of the resource Manager, Windows has an API provides this rule:
The STRCMPLOGICALW function in Shlwapi.dll
Unfortunately, Delphi does not seem to introduce this function at the moment, at least I did not see it in XE5 's winapi.shlwapi, so I can only manually reference the
After referencing, using the same way as other sorts, use the ListView example:
functionSTRCMPLOGICALW (P1, P2:pwidechar): Integer;stdcall;External 'Shlwapi.dll';procedureTform1.listview1columnclick (sender:tobject; Column:tlistcolumn);beginListview1.alphasort;End;procedureTform1.listview1compare (sender:tobject; Item1, Item2:tlistitem; Data:integer; varCompare:integer);beginCompare:=STRCMPLOGICALW (PChar (item1.caption), PChar (item2.caption));End;
Using the Windows Explorer collation