Incompatibility with Explorer's search
When I open file from Explorer's search results the navigation in ImageGlass is different from search window. Seems it just navigate all images in folder that contain opened file.
Expected behavior: ImageGlass file navigation is the same as I see in search results window.
To reproduce just try to search images through Explorer, then explore results through ImageGlass.

Duplication of #139
It's not a duplicate of #139, the issue still persists.
Yes, search results in explorer is a different beastie.
I'm not exactly sure how this is enabled but the expected behavior can be seen with Windows Photo Viewer (the one present since Vista/7, not the Photos app).
Steps:
- Use Windows Explorer's search box to filter files (returns filtered results from the current folder and any subfolders) OR open a Saved Search (.search-ms)
- (Optional) sort the results
- If Windows Photo Viewer is the default image handler, double click on an image. If not, right-click > Open With > Windows Photo Viewer
- Use arrow keys to go to next/previous image
Results: Windows Photo Viewer will go to the next/previous image in the search results or Saved Search. This is a flat view of all images that match the search query, regardless of what folder they are in, using the folder that was searched from as the root for additional images.
When repeating the same with ImageGlass (and the "Find images in child folder" option enabled), it uses the folder of the first opened image as the root, rather than the folder that was searched from, and displays all images from that folder and lower, including images that had been filtered out by the search query.
Bump. I found another request for this dating 2020, can we please add it soon? Literally the one thing missing from ImageGlass, I hate having to constantly go back to using Windows Photos because of the lack of this basic necessary functionality.
Would also like to see this being done. Any plans for doing so?
Would also like to see this being done. Any plans for doing so?
I haven't found any resources/API to retrieve the search result.
I'm not 100% positive but I think it might be related to the IFolderView2 interface
IFolderView2::GetItems? It's inherited from IFolderView but, I assume, with the extra stuff from Vista and newer (search folders/search results in an Explorer view). May or may not also need IFolderView2::GetSortColumns depending on if the collection is sorted or not.
I'm primarily a web developer rather than working with Windows apps so I'm not entirely sure but it seems like that should get all the items in the view. Take this with a grain of salt though as I don't have a dev environment to test it out myself.
The guts of the "support Window Explorer sort order" code can be found at:
It's in C++ because for the life of me, I could not get the necessary C# bindings to the COM functions to work.
Here is the primary challenge for supporting Search results:
Which Explorer window is ImageGlass supposed to pull the list from?
The current algorithm is:
ImageGlasshas been invoked to show an image. The filename includes the path to the image.ExplorerSortOrderiterates through the active Explorer windows. looking for the window whose Location property matches the provided image path.- The current sort order for said Explorer window is provided to ImageGlass.
A known limitation of this algorithm is the first Explorer window pointing at that folder is used. It may not be the window the user actually used to view said image file!
To support Search results will require something like this:
ImageGlasshas been invoked to show an image. The filename includes the path to the image.ExplorerSearchResultsiterates through the active Explorer windows.- For each window, use some criteria to determine if it might contain search results (e.g. the Location property is not set?)
- If a window might contain search results, invoke GetItems.
- Determine if the full image path (path+filename) is in the results.
- If so, provide the full list of items to ImageGlass.
- As mentioned, it may be necessary to also provide the sort order.
This has the same limitation: the first window containing the full image path in its list of items would be used, not necessarily the window actually used by the user.
ImageGlass would need at least the following changes:
- If
ExplorerSortOrderreturns no results, try invokingExplorerSearchResults. - Have the ability to view images based on a provided list, rather than reading the filenames from disk.
- When viewing images from a list, ignore commands or options which would conflict with the list, e.g. don't "scan within child folders".
All that said, I have no motivation or interest in creating ExplorerSearchResults. I am no longer actively participating in ImageGlass development.
So, if I'm understanding it correctly, this could work by adding GetItems to what's already there and using that instead of searching the directory/subdirectories of the opened image file IF (and only if) we know we have the correct Explorer window?
If we did know we had the correct window, then using GetItems would work for both search results (which already includes subdirectories) and regular folders (without subdirectories). The only difference would be for getting images in subdirectories when using a regular folder instead of a search.
Displaying the explorer search results in correct order would be just great. for my specific workflow this would be gold.