~LButton:: KeyWait, LButton MouseGetPos,,,, classNN `(`(hWnd:=WinActive("ahk_class CabinetWClass")) And classNN~="DirectUIHWND3|SysListView321") And WinExp(hWnd) Return ShowTip(p1, p2:=700) { TrayTip,, % p1 Sleep, p2 TrayTip } WinExp(p) { Static oShellWindows:=ComObjCreate("Shell.Application").windows Loop, % oShellWindows.count If (item:=oShellWindows.item(A_Index-1)).hwnd=p If (cnt:=(selItems:=item.document.selectedItems).count)=1 ShowTip("selected "((isExist:=FileExist(selItems.item(0).path))~="D" ? "folder":(isExist<>"") ? "file":"other")" ("selItems.item(0).type ")") Else ShowTip((cnt>1 ? "use single":"no")" selection") } |