-
-
Notifications
You must be signed in to change notification settings - Fork 457
Insert active explorer path #904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insert active explorer path #904
Conversation
|
tested working on win 10. this is awesome, thank you @Garulf let's consider how to implement this user experience wise
i noticed one of the dll is already used by flow- Shell32 |
|
@Flow-Launcher/team what do you guys think? |
wowwww awesome |
Would definitely like a global hotkey option as well as an option for automatic. |
|
This looks sweet @Garulf! Thank you!! Would you say this lays an adequate foundation for using the explorer plugin's |
I think it will be a separate effort. |
|
Maybe implement this under the explorer plugin? |
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some design questions over at https://github.com/Flow-Launcher/Flow.Launcher/pull/1018/files#r922377206
| if (shellWindow != null) | ||
| { | ||
| // Item without an index returns the current object | ||
| var currentFolder = shellWindow.Folder.Items().Item(); |
There was a problem hiding this comment.
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;
}There was a problem hiding this comment.
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.
|
@taooceros @Garulf I refactored the code a bit, see #1275 |
When Flow Launcher is invoked with an active Explorer.exe window selected Flow Launcher will open with that folder path selected.
Capture.13.mp4