Title StackVertical
File Name StackVertical.txt
Description Manage vertical button bar
Author Vochomurka
Parameters File name or "|"
(see comments)
Plugins Called win, file
Icon
Version 1.0
Updated on 23.06.2018
args BBar

static hwnd = win.handle("c=TTOTAL_CMD")
static Path = file.folder(win.exepath(hwnd))
static VB = Path ++ "\vertical.bar"
static VK = Path ++ "\vertical.bak"
local Success

if(BBar == "|" || Shift) do
	if(win.sendmessage(hwnd, 0x400+50, 29, 0))
		win.sendmessage(hwnd, 0x400+51, 2944, 0)

	Success = file.copy(VK, VB)

	if(Success)
		win.sendmessage(hwnd, 0x400+51, 2944, 0)

	quit
endif

Success = 1

if(win.sendmessage(hwnd, 0x400+50, 29, 0))
	win.sendmessage(hwnd, 0x400+51, 2944, 0)

wait.for(not win.sendmessage(hwnd, 0x400+50, 29, 0))

;ButtonBarTools – name of script ButtonBarTools
if(not validpath(BBar))
	BBar = ifelse(BBar, Path ++ "\" ++ BBar, .ButtonBarTools("b"))

if(not validpath(VK))
	Success = file.copy(VB, VK)

if(Success)
	Success = file.copy(BBar, VB)

if(Success)
	win.sendmessage(hwnd, 0x400+51, 2944, 0)

wait.for(500, win.sendmessage(hwnd, 0x400+50, 29, 0))

Comments

Is there a way to work with two button bars at the same time? In old versions there was no such way. In version 9 and later there is one way: one of these two bars is made horizontal as usual, another one is vertical.

How to make any bar vertical? First solution: rename it to vertical.bar and execute the cm_VisButtonbar2 command, or restart Total Commander. Second solution: point the cursor on the bar file of interest and press the following button:

TOTALCMD#BAR#DATA
OPENBAR2
%P%N
wciconex.dll


0
-1
There are even other solutions (e.g. with WM_COPYDATA). But all of them are time consuming, sophisticated and difficult.

Present script is simple and powerful. First, we can set the file name of bar as a parameter. So, after the script execution this bar gets vertical. The same goal is reached if to press the Ctrl key at the script start. If the path is not specified, %COMMANDER_PATH% is assumed. The "bar" extension is obligatory.

Script run without parameters or keys pressed gives all bar menu (detail see in the ButtonBarTools script comments).

After the work is done, the initial (native) vertical.bar should be restored with the "|" parameter of the script run, or the Shift key pressed


Main Page Total Commander PowerPro