Skip to content

Fix opening folder in Explorer way#17265

Closed
xomx wants to merge 3 commits intonotepad-plus-plus:masterfrom
xomx:fix_opening_folder_in_Explorer_way_in_Npp
Closed

Fix opening folder in Explorer way#17265
xomx wants to merge 3 commits intonotepad-plus-plus:masterfrom
xomx:fix_opening_folder_in_Explorer_way_in_Npp

Conversation

@xomx
Copy link
Copy Markdown
Contributor

@xomx xomx commented Dec 4, 2025

Fix #17060
and similar community issue https://community.notepad-plus-plus.org/topic/27276/open-containing-folder-in-explorer-always-launches-a-new-explorer-process-instead-of-re-using

STR & explanation with pics in the issue: #17060 (comment)


Using faster and less resource demanding way to open a folder in the Explorer.

Otherwise, with the previous ShellExecute "open" verb and "Explorer" cmd2Exec way, we got separate

"explorer.exe /factory,{75dff2b7-6936-4c06-a8bb-676a7b00b24b} -Embedding"

processes, launched by the service host process as parent by "svchost.exe -k DcomLaunch -p". These Explorer-processes then remained "alive" and blocked some allocated system resources, even if the user closed their corresponding Explorer folders.

Using faster and less resource demanding way to open a folder in the Explorer.

Otherwise, with the previous ShellExecute "open" verb and "Explorer" cmd2Exec way, we got separate

"explorer.exe /factory,{75dff2b7-6936-4c06-a8bb-676a7b00b24b} -Embedding"

processes, launched by the service host process as parent by "svchost.exe -k DcomLaunch -p". These Explorer-processes then remained "alive" and blocked some allocated system resources, even if the user closed their corresponding Explorer folders.
@chcg chcg added the bug label Dec 4, 2025
@OnceUponATimeInAmerica
Copy link
Copy Markdown

OnceUponATimeInAmerica commented Dec 5, 2025

With this PR, does Notepad++ also select the file in the Windows Explorer or does it just open the containing folder (because only the current directory is being used and not the current file path)? If not, then it's not the same as the old behavior (which also selected the file, though inconveniently using additional Explorer.exe processes).

It seems to be technically just Open the containing folder in Explorer and not (like VS code's arguably more helpful) Reveal in File Explorer.

Thanks.

@xomx
Copy link
Copy Markdown
Contributor Author

xomx commented Dec 5, 2025

or does it just open the containing folder

Only this.

Good point. So, looks like I won't be able to avoid bigger changes and will have to check that SHOpenFolderAndSelectItems way.

@xomx xomx marked this pull request as draft December 5, 2025 14:48
xomx added 2 commits December 16, 2025 00:23
and the ShellExecute way with the "explore" verb, only as a fallback
@xomx xomx marked this pull request as ready for review December 15, 2025 23:54
@donho donho self-assigned this Dec 20, 2025
@donho
Copy link
Copy Markdown
Member

donho commented Dec 20, 2025

I hate COM, but it seems that we have no much choice.

@donho donho added accepted enhancement Proposed enhancements of existing features and removed bug labels Dec 20, 2025
@donho donho closed this in d31f75d Dec 20, 2025
@xomx xomx deleted the fix_opening_folder_in_Explorer_way_in_Npp branch December 20, 2025 18:54
@xomx
Copy link
Copy Markdown
Contributor Author

xomx commented Dec 20, 2025

@donho

I hate COM

I see, but for me, it's one of the things that the MS has done very well.

And when used like this from N++, it becomes in fact only a simple & fast in-proc server (just like when you call a func in a DLL) and not the slower & more complicated RPC one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted enhancement Proposed enhancements of existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] New representations of the Windows Explorer application added to Windows Task Manager when folders opened via Notepad++.

4 participants