Last active
August 17, 2020 15:11
-
-
Save tablacus/86679075c7c398e22d54955e2f6f29dd to your computer and use it in GitHub Desktop.
Auto arrange on rename - Tablacus Explorer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AddEvent("ChangeNotify", function (Ctrl, pidls, wParam, lParam) { | |
if (pidls.lEvent & (SHCNE_RENAMEITEM | SHCNE_RENAMEFOLDER)) { | |
var pid = api.ILGetParent(pidls[1]); | |
api.SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_IDLIST, pid, null); | |
var FV = GetFolderView(); | |
if (FV && api.ILIsEqual(FV, pid)) { | |
if (FV.ItemCount(SVGIO_SELECTION) == 1) { | |
setTimeout(function() { | |
var Selected = FV.SelectedItems(); | |
if (api.ILIsEqual(Selected.Item(0), pidls[1])) { | |
FV.SelectItem(pidls[1], SVSI_SELECT | SVSI_FOCUSED | SVSI_ENSUREVISIBLE | SVSI_NOTAKEFOCUS); | |
} | |
}, 99); | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is used in an add-on "Run at setup".