Windows Explorer: How to open the folder when I navigate on the left pane? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
leihu
Posts: 51
Joined: 19 Mar 2020, 22:08

Windows Explorer: How to open the folder when I navigate on the left pane?

11 Apr 2021, 09:28

Hi Experts:

When I navigate the left navigation pane of Windows Explorer using keyboard, I want it to open the highlighed folder and display its subfolders on the right pane. This is a Windows XP feature, but don't know why MS removed it from Windows 7 and 10. Can anyone help? Perferrably, COM model method.

Also can anyone tell me how to scroll the left pane and the right pane of Explorer using COM object method? If you can also point me to some Explorer COM model tutorials, that'd be great.

Thanks a lot!!
User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Windows Explorer: How to open the folder when I navigate on the left pane?

11 Apr 2021, 11:53

In case you are not aware of this, Microsoft has updated the old File Manager to work on Windows 10, and it is available for download at the Microsoft store.
leihu
Posts: 51
Joined: 19 Mar 2020, 22:08

Re: Windows Explorer: How to open the folder when I navigate on the left pane?

12 Apr 2021, 02:22

boiler wrote:
11 Apr 2021, 11:53
In case you are not aware of this, Microsoft has updated the old File Manager to work on Windows 10, and it is available for download at the Microsoft store.
Hi boiler,

Thanks for your reply. Yes, I know that, but I don't like it.

Can you or anyone else answer my questions?

Thanks!!
User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Windows Explorer: How to open the folder when I navigate on the left pane?

12 Apr 2021, 10:38

This doesn't use COM, but it does what you describe when using the up/down arrow keys to navigate the left pane in File Explorer:

Code: Select all

#If ExplorerTreeFocus()
$Up::Send, {Up}{Enter}
$Down::Send, {Down}{Enter}

ExplorerTreeFocus() {
	ControlGetFocus, FocusedCtrl, ahk_class CabinetWClass ahk_exe explorer.exe
	ToolTip, % "Focused control: " FocusedCtrl
	return FocusedCtrl = "SysTreeView321"
}

If you want to use COM, this reference from Microsoft may help.
leihu
Posts: 51
Joined: 19 Mar 2020, 22:08

Re: Windows Explorer: How to open the folder when I navigate on the left pane?

12 Apr 2021, 11:21

boiler wrote:
12 Apr 2021, 10:38
This doesn't use COM, but it does what you describe when using the up/down arrow keys to navigate the left pane in File Explorer:

Code: Select all

#If ExplorerTreeFocus()
$Up::Send, {Up}{Enter}
$Down::Send, {Down}{Enter}

ExplorerTreeFocus() {
	ControlGetFocus, FocusedCtrl, ahk_class CabinetWClass ahk_exe explorer.exe
	ToolTip, % "Focused control: " FocusedCtrl
	return FocusedCtrl = "SysTreeView321"
}

If you want to use COM, this reference from Microsoft may help.
Hi boiler,

Thanks again for your solution! Yes, this is a nice and simple solution, but not practical at least to me. Very often I need to quickly walk through the folder list (on the navigation pane) from top to bottom or from bottom to top by pressing and holding the up/down keys, but the solution respond too slow.

Is there any other solutions?

Also, thanks for the COM reference. But I'm afraid I don't have enough knowledge to understand that. For example, how can AHK link to that. If you could point out some simpler tutorials, that'd be great!!
User avatar
rommmcek
Posts: 1470
Joined: 15 Aug 2014, 15:18

Re: Windows Explorer: How to open the folder when I navigate on the left pane?  Topic is solved

12 Apr 2021, 11:38

@boiler: Cool indeed!
@leihu: Try this version:

Code: Select all

#MaxThreads 1
#If ExplorerTreeFocus()
~Up::
~Down::SetTimer, OpenPane, -250      ; you can adjust this value (e.g.:  -150 to -500)

ExplorerTreeFocus() {
	ControlGetFocus, FocusedCtrl, ahk_class CabinetWClass ahk_exe explorer.exe
	ToolTip, % "Focused control: " FocusedCtrl
	return FocusedCtrl = "SysTreeView321"
}

OpenPane() {
    Send, {Enter}
}
User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Windows Explorer: How to open the folder when I navigate on the left pane?

12 Apr 2021, 12:15

Oh, by the way, I just noticed I left the ToolTip in there. It was just for verification while I wrote it, so it should be removed in the event you find rommmcek’s nice modification to your liking.

Regarding the COM approach, I might take a shot at it later, but often those things can be tricky. Perhaps another member who is better at using those methods will reply.
leihu
Posts: 51
Joined: 19 Mar 2020, 22:08

Re: Windows Explorer: How to open the folder when I navigate on the left pane?

12 Apr 2021, 22:50

rommmcek wrote:
12 Apr 2021, 11:38
@boiler: Cool indeed!
@leihu: Try this version:

Code: Select all

#MaxThreads 1
#If ExplorerTreeFocus()
~Up::
~Down::SetTimer, OpenPane, -250      ; you can adjust this value (e.g.:  -150 to -500)

ExplorerTreeFocus() {
	ControlGetFocus, FocusedCtrl, ahk_class CabinetWClass ahk_exe explorer.exe
	ToolTip, % "Focused control: " FocusedCtrl
	return FocusedCtrl = "SysTreeView321"
}

OpenPane() {
    Send, {Enter}
}
@rommmcek
@boiler

Hi There!

Yes! This one works even though it's not ideal. If I set the number too small, it's not smooth enough; if it's too big, it delays too much when I release the keys. But it works. It's usable! BTW, I also added Left and Right as I often press the left key to quickly jump to parent folders.

@boiler as for the COM method, sample code would be great. But if you can point me to some documents, that's also helpful as I cannot find the starting point to get started. BTW, I did COM programming in C/C++ for a year or so about ten years ago. :oops:

If anyone else can help with COM, please!

Finally, thank you both. You're great!!
User avatar
rommmcek
Posts: 1470
Joined: 15 Aug 2014, 15:18

Re: Windows Explorer: How to open the folder when I navigate on the left pane?

15 Apr 2021, 14:38

Further improvement:

Code: Select all

#If ExplorerTreeFocus()
~Up::
~Down::SetTimer, OpenPane, -250 ; set to your liking

ExplorerTreeFocus() {
	ControlGetFocus, FocusedCtrl, ahk_class CabinetWClass ahk_exe explorer.exe
	;ToolTip, % "Focused control: " FocusedCtrl
	return FocusedCtrl = "SysTreeView321"
}

OpenPane() {
    if !GetKeyState("Up", "P") && !GetKeyState("Down", "P")
        Send, {Enter}
}
leihu
Posts: 51
Joined: 19 Mar 2020, 22:08

Re: Windows Explorer: How to open the folder when I navigate on the left pane?

26 Sep 2021, 09:51

rommmcek wrote:
15 Apr 2021, 14:38
Further improvement:

Code: Select all

#If ExplorerTreeFocus()
~Up::
~Down::SetTimer, OpenPane, -250 ; set to your liking

ExplorerTreeFocus() {
	ControlGetFocus, FocusedCtrl, ahk_class CabinetWClass ahk_exe explorer.exe
	;ToolTip, % "Focused control: " FocusedCtrl
	return FocusedCtrl = "SysTreeView321"
}

OpenPane() {
    if !GetKeyState("Up", "P") && !GetKeyState("Down", "P")
        Send, {Enter}
}

@rommmcek

Hi rommmcek,

Sorry, just saw your improved post. Thank you very much!!

HL

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: catquas, Google [Bot], jpsala, mmflume and 176 guests