I would like to know if there is a way to know how the files in a Windows Explorer window are sorted. Kind of having the "ORDER BY" clause of the window. Example : "Name ascending" or "Date Modified Descending".
This question is NOT about windows' name-sorting algorithm, but about user-defined sort criteria of a specific open Windows Explorer window.
The goal is, when I double-click on an image in Windows Explorer, to start my program (no problem there), and to find which were the previous and next images (for my program's previous and next buttons), as it was in the explorer window.
Do you know if it's possible, and if so, how ?
That would be perfect if it were in C#, but even C++ would be great.
I guess you could use the shell extension to persist the current sort order of all windows explorer sessions to disk when they changed, with timestamps. Then you read that data into your app when needed to decide how the UI is rendered.
来源:https://stackoverflow.com/questions/14401016/get-the-field-on-which-the-explorer-window-is-sorted