Get list of all open folders (from Explorer windows)?

Windows specific forum
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Get list of all open folders (from Explorer windows)?

Post by Michael Vogel »

Work in process...
...not sure what the 'Address' is what you are searching for.

Code: Select all

; Define

	Structure ObjectType
		Handle.i
		Title.s
		Class.s
	EndStructure

; EndDefine

Procedure GetObjectInfo(*Object.ObjectType,Set=#False)

	#MaxTextLength=256

	With *Object

		If Set
			\Handle=Set
		EndIf

		If \Handle
			\Title=Space(#MaxTextLength)
			\Class=Space(#MaxTextLength)
			GetWindowText_(\Handle,\Title,#MaxTextLength)
			GetClassName_(\Handle,\Class,#MaxTextLength)
			ProcedureReturn #True

		Else
			ProcedureReturn #False
		EndIf

	EndWith

EndProcedure

o.ObjectType

Explorer=FindWindow_("CabinetWClass",#Null)
; Explorer=FindWindowEx_(Explorer,#Null,"Microsoft.UI.Content.DesktopChildSiteBridge",#Null)
; Explorer=FindWindowEx_(Explorer,#Null,"Microsoft.UI.Xaml.Controls.TabView",#Null)
; Explorer=FindWindowEx_(Explorer,#Null,"ListView",#Null)

If Explorer
	With o
		Win=GetWindow_(Explorer,#GW_CHILD)
		While Win
			If GetObjectInfo(o,Win)
				If \Class="ShellTabWindowClass"
					Debug \Title
					EndIf
			EndIf
			Win=GetWindow_(Win,#GW_HWNDNEXT)
		Wend
	EndIf

EndWith

normeus
Enthusiast
Enthusiast
Posts: 470
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

Re: Get list of all open folders (from Explorer windows)?

Post by normeus »

using the code from first post PB, 6.11 W11

Image

my windows version:
Image

I see the names of the open folders
Norm
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
BarryG
Addict
Addict
Posts: 4121
Joined: Thu Apr 18, 2019 8:17 am

Re: Get list of all open folders (from Explorer windows)?

Post by BarryG »

Thanks for trying again. Nothing works for my Win 11 Pro. :( I bet that AutoHotkey code would work, but I don't know how to code COM stuff.

My code in the first post in this topic outputs this (no path, just the final folder name for the "C:\Temp" folder that I had open as a test):

Image
Post Reply