In Windows 10, capturing the full path to the folder displayed in the active Explorer window was as easy as getting the text content of its address bar using
Code: Select all
ControlGetText, var, ToolbarWindow323, A
which returned something like say
Address: C:\Program Files\Common Files, independently of Explorer's "
Display the full path in the title bar" setting. But now in Windows 11, the address bar is a godawful (apparently unreadable) "
Microsoft.UI.Content.DesktopChildSiteBridge" control and
Code: Select all
ControlGetText, var, Microsoft.UI.Content.DesktopChildSiteBridge1, A
returns an empty string (
Window Spy confirms there's no retrievable text there). I've also confirmed that no control in an Explorer window, whether visible or hidden, contains the folder's full path. Getting the window's title text via
WinGetTitle does provide the folder's path, but
only if "
Display the full path in the title bar" is enabled, which can't be counted on.
Does any other approach come to mind to
reliably capture the full path of the folder displayed in the current Explorer window?
Thanks.
JB