My app Folders Popup is using the command ComObjCreate("Shell.Application").Explore(strPath) to create a new Explorer window. I need a way to tell this new instance of Explorer to comply with the Navigation Pane setting decided by the user (to show or not show the pane) in previous Explorer windows.

Actually, this setting is not taken into account by default in the new instance created by the Shell command and users of my app who prefer to use Explorer without this navigation pane are annoyed to see it reappear when my app is opening a new Explorer. Is there any solution to this (except sending keys to the Explorer, what I prefer to avoid)?

有帮助吗?

解决方案

Simpler is sometimes better ;)

The Run command isn't just for executables, it can also open non-executable files like images/documents (as long as their file type is associated) and especially folders:

myFolderPath = C:\Path\To\Folder
Run, %myFolderPath%

Generally, it makes sense to use built-in commands or functions if available, before incorporating ActiveX, COM objects or DLL calls; those should provide extra functionality, and not replace what AHK can do out of the box. That, of course, occasionally requires some digging into the docs, but it's worth it! AHK is one of the most well-documented automation scripting languages for Windows.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top