TreeDownTC

Title TreeDownTC
File Name TreeDownTC.txt
Description Move down directory tree using only internal commands
Author Vochomurka
Parameters -
Plugins Called win
Version 1.0
Updated on 28.10.19
static hwnd = win.handle("c=TTOTAL_CMD")
static P = win.sendmessage(hwnd, 0x400+50, 1000, 0)
static T, C, F1

if(!win.sendmessage(hwnd, 0x400+50, 1008 + P, 0)) do
	messagebox("ok error", "No updir", "TreeDownTC Script")
	quit
endif

for(;1;)
	T = win.sendmessage(hwnd, 0x400+50, 1002 + P, 0)
	C = win.sendmessage(hwnd, 0x400+50, 1006 + P, 0)

	if(C == 0) do
		if(T == 1) do
			IsLastDir()
			continue
		else
			win.sendmessage(hwnd, 0x400+51, 2055, 0)
		endif
		continue
	endif

	F1 = win.sendmessage(hwnd, 0x400+50, 1010 + P, 0)
	if(length(F1) > 9 && T > 1) do
		win.sendmessage(hwnd, 0x400+51, 2003, 0)
		break
	endif

	if(T == 1 || C >= F1 || F1 == 1) do
		IsLastDir()
		continue
	endif

	win.sendmessage(hwnd, 0x400+51, 2003, 0)
	break
endfor

quit all

Function IsLastDir()
if(!win.sendmessage(hwnd, 0x400+50, 1008 + P, 0)) do
	*Exec Prompt 1 Last folder in root visited. Go to the next drive?
	if(not pproflag(1))
		quit all

	win.sendmessage(hwnd, 0x400+51, 2051, 0)
	win.sendmessage(hwnd, 0x400+51, 2001, 0)
	quit all
endif

win.sendmessage(hwnd, 0x400+51, 2002, 0)

C = win.sendmessage(hwnd, 0x400+50, 1006 + P, 0)
T = win.sendmessage(hwnd, 0x400+50, 1002 + P, 0)
if(C + 1 == T) do
	IsLastDir()
else
	win.sendmessage(hwnd, 0x400+51, 2055, 0)
endif

Main Page Total Commander PowerPro