Skip to content

Conversation

@Garulf
Copy link
Member

@Garulf Garulf commented Dec 15, 2021

When Flow Launcher is invoked with an active Explorer.exe window selected Flow Launcher will open with that folder path selected.

Capture.13.mp4

@Garulf Garulf self-assigned this Dec 15, 2021
@Garulf Garulf marked this pull request as draft December 15, 2021 10:22
@jjw24
Copy link
Member

jjw24 commented Dec 15, 2021

tested working on win 10.

this is awesome, thank you @Garulf

let's consider how to implement this user experience wise

  • include in explorer plugin?
  • hotkey to activate?
  • option to activate automatically?

i noticed one of the dll is already used by flow- Shell32

@jjw24
Copy link
Member

jjw24 commented Dec 15, 2021

@Flow-Launcher/team what do you guys think?

@taooceros
Copy link
Member

@Flow-Launcher/team what do you guys think?

wowwww awesome

@Garulf
Copy link
Member Author

Garulf commented Dec 16, 2021

tested working on win 10.

this is awesome, thank you @Garulf

let's consider how to implement this user experience wise

  • include in explorer plugin?
  • hotkey to activate?
  • option to activate automatically?

i noticed one of the dll is already used by flow- Shell32

Would definitely like a global hotkey option as well as an option for automatic.

@Garulf Garulf closed this Dec 16, 2021
@Garulf Garulf reopened this Dec 16, 2021
@maholli
Copy link

maholli commented Jan 9, 2022

This looks sweet @Garulf! Thank you!!

Would you say this lays an adequate foundation for using the explorer plugin's doc: keyword to search file content within a given directory? Or would such a feature require a separate effort?

@taooceros
Copy link
Member

Would you say this lays an adequate foundation for using the explorer plugin's doc: keyword to search file content within a given directory? Or would such a feature require a separate effort?

I think it will be a separate effort.

@taooceros
Copy link
Member

Maybe implement this under the explorer plugin?
We can add a hook for plugins to do something they want when showing up the window.

@stefnotch
Copy link
Contributor

Maybe implement this under the explorer plugin? We can add a hook for plugins to do something they want when showing up the window.

Alternatively, an API could be exposed to try to get the file explorer window. If there is an open one, its path is returned. That way, plugins could mostly decide what to do with the information.

private static string GetActiveExplorerPath()
{
// get the active window
IntPtr handle = GetForegroundWindow();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (shellWindow != null)
{
// Item without an index returns the current object
var currentFolder = shellWindow.Folder.Items().Item();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gotten far more consistent results with the following. It also seems to handle special cases like the documents folder or the recycle bin folder.

string locationUrl = window.LocationURL;
if (!string.IsNullOrEmpty(locationUrl))
{
    string folderPath = new Uri(locationUrl).LocalPath;
    return folderPath;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can fire a pr based on this one, and modify code there. @Garulf will have access to modify your pr so it would be easier to review and edit the code.

@stefnotch
Copy link
Contributor

@taooceros @Garulf I refactored the code a bit, see #1275
Feel free to use the improvements, and let me know if that's better.

@taooceros taooceros merged commit aa5ca76 into Flow-Launcher:dev Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

[Feature request] quick search within the current folder in windows explorer

5 participants