Created
December 18, 2021 13:59
-
-
Save tablacus/cc9562cb20e0d31bdb7ce41a57f91a58 to your computer and use it in GitHub Desktop.
Toggle selection with inline renaming - Tablacus Explorer
This file contains hidden or 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 hEdit = api.SendMessage(FV.hwndList, LVM_GETEDITCONTROL, 0, 0); | |
| const fn = api.GetWindowText(hEdit); | |
| let start = api.SendMessage(hEdit, 0xB0, 0, 0);//EM_GETSEL | |
| const end = Math.floor(start >> 16); | |
| start &= 0xffff; | |
| if (fn.indexOf(".") >= 0) { | |
| if (start) { | |
| api.SendMessage(hEdit, 0xB1, 0, fn.length);//EM_SETSEL | |
| } else { | |
| if (end == fn.length) { | |
| api.SendMessage(hEdit, 0xB1, 0, fso.GetBaseName(fn).length);//EM_SETSEL | |
| } else { | |
| api.SendMessage(hEdit, 0xB1, fn.length - fso.GetExtensionName(fn).length, fn.length);//EM_SETSEL | |
| } | |
| } | |
| } else { | |
| api.SendMessage(hEdit, 0xB1, 0, start == end ? fn.length : 0);//EM_SETSEL | |
| } |
Author
If you don't know what this does:
It switches from name to extension to name+extension upon each press of "F2" (Rename-Shortcut).
Example Video:
https://user-images.githubusercontent.com/23098362/148750909-90adbd05-5f43-4eda-8f0e-10e13f5eafec.mp4
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add-on : Key
Location: Edit