I am using the standard FindFirst and FindNext to retrieve all files in a directory but I need the results to come back sorted ( in the same order that clicking on the name column in explorer would sort them basically ) How can I achive this This has to be done via Win32 Thanks
I am using the standard FindFirst and FindNext to retrieve all files in a
Share
You can use the Indexing Service for this, but I would recommend just to handle the sorting yourself while using FindFirstFile.
Sorting is not possible with the FindFirstFile Win32 API. There is a slightly more advanced FindFirstFileEx, but even that does not allow sorting.
There is a Raymond Chen post on The Old New Thing about FindFirstFile’s limitations.
Your best bet is probably to load all results into a vector, and then sort that.