Skip to content

Instantly share code, notes, and snippets.

Avatar

Gaku tablacus

View GitHub Profile
@tablacus
tablacus / EnableShellExecuteHooks.js
Created Aug 4, 2017
EnableShellExecuteHooks "on" with Tablacus Explorer Add-on Shell execute hook 1.02 or higher.
View EnableShellExecuteHooks.js
var ex = { EnableShellExecuteHooks: true, Explorer: true };
OpenNewProcess("addons\\shellexecutehook\\worker.js", ex, false, WINVER >= 0x600 ? "RunAs" : null);
@tablacus
tablacus / RefreshKeepSelected.js
Last active Aug 8, 2017
Refresh (Keep selected) - Tablacus Explorer
View RefreshKeepSelected.js
var FV = GetFolderView(Ctrl, pt);
var Selected = FV.SelectedItems();
FV.Refresh();
if (Selected && Selected.Count) {
for (var i = Selected.Count; i--;) {
FV.SelectItem(Selected.Item(i), SVSI_SELECT);
}
FV.SelectItem(Selected.Item(0), SVSI_SELECT | SVSI_FOCUSED);
}
View SwitchViewMode1.js
var FV = GetFolderView(Ctrl, pt);
if (FV) {
var hMenu = api.CreatePopupMenu(), hSubMenu;
var ContextMenu = FV.ViewMenu();
if (ContextMenu) {
ContextMenu.QueryContextMenu(hMenu, 0, 1, 0x7fff, CMF_DEFAULTONLY);
var mii = api.Memory("MENUITEMINFO");
mii.cbSize = mii.Size;
mii.fMask = MIIM_SUBMENU;
for (var i = 0; i < api.GetMenuItemCount(hMenu); i++) {
View SwitchViewMode2.js
var FV = GetFolderView(Ctrl, pt);
if (FV) {
var hMenu = api.CreatePopupMenu(), hSubMenu;
var ContextMenu = FV.ViewMenu();
if (ContextMenu) {
ContextMenu.QueryContextMenu(hMenu, 0, 1, 0x7fff, CMF_DEFAULTONLY);
var mii = api.Memory("MENUITEMINFO");
mii.cbSize = mii.Size;
mii.fMask = MIIM_SUBMENU;
for (var i = 0; i < api.GetMenuItemCount(hMenu); i++) {
@tablacus
tablacus / StartupToTray.js
Created Aug 25, 2017
Start Tablacus Explorer to System tray. Require "Systray", "Startup settings" - Tablacus Explorer
View StartupToTray.js
Addons.TaskTray.CreateIcon();
te.CmdShow = SW_HIDE;
@tablacus
tablacus / ToggleShellExecuteHooks.js
Last active Aug 28, 2017
EnableShellExecuteHooks "toggle" with Tablacus Explorer Add-on Shell execute hook 1.02 or higher.
View ToggleShellExecuteHooks.js
var toggle;
try {
  toggle = !wsh.RegRead("HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\EnableShellExecuteHooks");
} catch (e) {
  toggle = true;
}
var ex = { EnableShellExecuteHooks: toggle, Explorer: true };
OpenNewProcess("addons\\shellexecutehook\\worker.js", ex, false, WINVER >= 0x600 ? "RunAs" : null);
@tablacus
tablacus / DisableShellExecuteHooks.js
Last active Aug 28, 2017
EnableShellExecuteHooks "off" with Tablacus Explorer Add-on Shell execute hook 1.02 or higher.
View DisableShellExecuteHooks.js
var ex = { EnableShellExecuteHooks: false, Explorer: false };
OpenNewProcess("addons\\shellexecutehook\\worker.js", ex, false, WINVER >= 0x600 ? "RunAs" : null);
@tablacus
tablacus / ToggleSplitPaneHorizontal.js
Last active Aug 28, 2017
Toggle split pane (Horizontal) Require "Split" - Tablacus Explorer
View ToggleSplitPaneHorizontal.js
if (te.Ctrls(CTRL_TC, true).Count > 1) {
Addons.Split.Exec(1, 1);
} else {
Addons.Split.Exec(2, 2);
}
@tablacus
tablacus / ToggleSplitPaneVertical.js
Last active Aug 28, 2017
Toggle split pane (Vertical) Require "Split" - Tablacus Explorer
View ToggleSplitPaneVertical.js
if (te.Ctrls(CTRL_TC, true).Count > 1) {
Addons.Split.Exec(1, 1);
} else {
Addons.Split.Exec(2, 3);
}
@tablacus
tablacus / MoveTo.js
Last active Sep 10, 2017
Move selected items to c:\test - Tablacus Explorer
View MoveTo.js
var FV = GetFolderView(Ctrl, pt);
var Selected = FV.SelectedItems();
if (Selected && Selected.Count) {
var DropTarget = api.DropTarget("c:\\test");
DropTarget.Drop(Selected, MK_LBUTTON | MK_SHIFT, pt, Selected.pdwEffect);
}