Sorry for opening this post again, but I found an error and did some improvements to the code:
Code:
FunBackspaceExplorer()
{
If WinActive, ahk_class CabinetWClass
{
ControlGetFocus focussed, A
; Return true only if current control isn't an edit control
if (NOT InStr(focussed, "Edit"))
Return 1
}
return 0
}
#If FunBackspaceExplorer()
Backspace::
SendInput !{Up}
#IfWinActive
The error was that SysTreeView321 was not quoted, so backspace functionality was activated only if focus was on main control.
I've moved the code that cheks if current window is correct to a funcion so that the backspace hotkey exists only if all conditions are met.
Now it simply checks if the current control isn't an edit one (Edit1 is active while renaming an item, Edit2 is active when typing the path in the bar, and maybe there are more of them so I did the InStr() thing) so that backspace functionality is enabled whatever the current cotrol is.
I've only checked this on Win7, but it should be ok in Vista too.