Get the field on which the explorer window is sorted
Asked Answered
B

1

0

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.

Brake answered 18/1, 2013 at 14:28 Comment(4)
Check out this shell extension tutorial codeproject.com/Articles/722/…Diesel
What if there are two Explorer windows open, each with different sort orders?Martian
@RaymondChen : I guess, if 2 windows were open on this folder, i would use the "closest" one (the one over the other), but that would be another question, which I am sure I would find the answer to on the Internet, quite easily.Brake
And if no windows were open? At any rate, once you figure out which one you want, you can call IFolderView2::GetSortColumns.Martian
E
0

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.

Escarole answered 23/9, 2014 at 0:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.