Last active
March 21, 2021 13:27
-
-
Save tablacus/449b7f93415c9e2a646b50d75383d5bd to your computer and use it in GitHub Desktop.
All selected items on top of the list - 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
const FV = GetFolderView(Ctrl, pt); | |
const Selected = FV.Items(SVGIO_SELECTION | SVGIO_FLAG_VIEWORDER); | |
const Progress = api.CreateObject("ProgressDialog"); | |
Progress.StartProgressDialog(te.hwnd, null, 2); | |
const Name = GetText("Selected items"); | |
try { | |
FV.SelectItem(null, SVSI_DESELECTOTHERS); | |
const IconSize = FV.IconSize; | |
const ViewMode = api.SendMessage(FV.hwndList, LVM_GETVIEW, 0, 0); | |
if (ViewMode == 1 || ViewMode == 3) { | |
api.SendMessage(FV.hwndList, LVM_SETVIEW, 4, 0); | |
} | |
const FolderFlags = FV.FolderFlags; | |
FV.FolderFlags = FolderFlags | FWF_AUTOARRANGE; | |
FV.GroupBy = "System.Null"; | |
const pt2 = api.Memory("POINT"); | |
FV.GetItemPosition(FV.Item(0), pt2); | |
const nMax = Selected.Count; | |
Progress.SetLine(1, api.LoadString(hShell32, 50690) + " " + Name, true); | |
for (let i = 0; !Progress.HasUserCancelled(i, nMax, 2) && i < nMax; ++i) { | |
FV.SelectAndPositionItem(Selected.Item(nMax - i - 1), SVSI_DESELECT, pt2); | |
} | |
FV.SelectItem(Selected, SVSI_SELECT | SVSI_FOCUSED); | |
api.SendMessage(FV.hwndList, LVM_SETVIEW, ViewMode, 0); | |
FV.FolderFlags = FolderFlags; | |
FV.IconSize = IconSize; | |
} catch (e) { } | |
Progress.StopProgressDialog(); |
Author
tablacus
commented
Mar 17, 2021
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment