With help on this forum I'm using opening selected files/folders (in Explorer) in many applications - works correctly.
But now I'm using Explorer replacement XYplorer and with this cannot work - of course, in code is used Explorer.
My Q is maybe not so easy, but here's:
Is possible to apply it on XYplorer?
And even - recognize if is selected item in Explorer or XYplorer?
Here's code:
Code: Select all
Selected_Files()
{
; Handles Explorer
IfWinActive, ahk_class CabinetWClass
{
for window in ComObjCreate("Shell.Application").Windows
if window.HWND = WinExist("A")
this_window := window
; If multiple Items selected
if(this_window.Document.SelectedItems.Count > 1)
{
these_files := ""
for item in this_window.Document.SelectedItems
these_files .= item.Path . "`n"
return these_files
}
else
return this_window.Document.FocusedItem.Path
}
; Handles Desktop
if(WinActive("ahk_class Progman") || WinActive("ahk_class WorkerW"))
{
ControlGet, selectedFiles, List, Selected Col1, SysListView321, A
; If multiple Items selected
if InStr(selectedFiles, "`n")
{
these_files := ""
Loop, Parse, selectedFiles, `n, `r
these_files .= A_Desktop . "\" . A_LoopField . "`n"
return these_files
}
else
return A_Desktop . "\" . selectedFiles
}
else
return false
}
Code: Select all
Window text: G:\ - XYplorer 17.60.0100
ahk_class ThunderRT6FormDC
ahk_exe XYplorer.exe
Thank you for all.
Miro