Navigate-browse between folders without Tree

English support forum

Moderators: white, Hacker, petermad, Stefan2

Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Navigate-browse between folders without Tree

Post by *Fla$her »

petermad wrote: 2023-03-09, 02:07 UTCNot easy to know whether it had to be installed or unpacked, if you haven't used it before.
Are you talking about yourself? The program is almost 13 years old. It's amazing that for so many years, with all its many advantages, you, as an experienced TC user, have never tried to use it. :shock:
petermad wrote: 2023-03-09, 02:07 UTCNo, but the usability was not the issue of your statement:
It was. The solution always means the result of the work, and not the preparatory moments with a slight waste of time.
petermad wrote: 2023-03-09, 02:07 UTCbut that is only when you don't want to continue up the tree (which I would prefer).
A rather dubious preference. It's even hard to imagine when such a thing might be needed.
petermad wrote: 2023-03-09, 02:07 UTCAnd why the cm_ReloadSelThumbs at the end?
As a result, the cursor is restored after the lock.
petermad wrote: 2023-03-09, 02:07 UTCThis mad me make this request
You were a little hasty. It was worth discussing beforehand. I'll answer there.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Navigate-browse between folders without Tree

Post by *petermad »

It's amazing that for so many years, with all its many advantages, you, as an experienced TC user, have never tried to use it.
But nevertheless true, as I also have never gone into AHK-scripting :oops:

The readme file for TCFS2, does not give much help to get started using it, is there a more elaborate manual somewhere?

For exampe this from readme.txt:
readme.txt wrote: msg(<umsg>, <wparam>, <lparam>, [<async_mode> = 0])
Sends a message to TC window. If async_mode>0, message will be sent using PostMessage function, if async_mode<0, it will be sent using SendMessage (as if async_mode = 0), but w/o waiting for result. If you pass a string as wparam or lparam, string address will be passed in message;
I can find no definition in the readme file for umsg, wparam, lparam and async_mode.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Navigate-browse between folders without Tree

Post by *Fla$her »

petermad wrote: 2023-03-09, 12:07 UTCBut nevertheless true, as I also have never gone into AHK-scripting :oops:
Most TCFS2 users do not know AHK, but they have enough skill to bring together a sequence of ready-made commands and functions. ;)
petermad wrote: 2023-03-09, 12:07 UTCThe readme file for TCFS2, does not give much help to get started using it, is there a more elaborate manual somewhere?
Unfortunately, no.
petermad wrote: 2023-03-09, 12:07 UTCI can find no definition in the readme file for umsg, wparam, lparam and async_mode.
Google the specified PostMessage and SendMessage. It says here that they are used to send messages to TC window. umsg is just a numeric message identifier, and wparam, lparam are additional, but not always required parameters. There are too many API functions, and we don't need most of them, so TCFS2.Core.ini lists potential constants for msg functions as macros (WM_TC_COMMAND as the most popular), on the basis of which other macros and ready-made functions and commands are built for regular use, including in sequences. For a better understanding of how msg works, I advise you to read ReadMe.txt for TCFS2Tools.

For additional questions, please contact the profile topic. It's never too late to start. ;)
Overquoting is evil! 👎
User avatar
LonerD
Senior Member
Senior Member
Posts: 381
Joined: 2010-06-19, 20:18 UTC
Location: Makeyevka, Russia
Contact:

Re: Navigate-browse between folders without Tree

Post by *LonerD »

My old but still actual Autohotkey script.
No flickering, forward and backward navigation, circle navigation (if it's last directory, then go to first).

Code: Select all

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
; Total Commander DreamLair                        ;
; Script: Go to parallel directory                 ;
; Скрипт: Перехід в паралельний каталог            ;
; Script version: 1.0 (2018.09.30)                 ;
; Required: Total Commander 9.0+                   ;
; Script author: LonerD                            ;
; Site: https://dreamlair.net                      ;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
; Вихід з поточного каталогу на рівень вище        ;
; та перехід в наступний або попередній каталог.   ;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
; Parameter:                                       ;
;     1 - backward navigation                      ;
;         зворотня навігація / обратная навигация  ;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;

#NoEnv
#NoTrayIcon
#SingleInstance force
SetBatchLines, -1
SendMode Input

If not ( WinExist("ahk_class TTOTAL_CMD") || WinActive("ahk_class TTOTAL_CMD") )
  ExitApp
WinGet, hw_TTOTAL_CMD, ID, A
global hw_TTOTAL_CMD

NavMode = %1%
if ( NavMode != 1 )
  NavMode = 0

DllCall("LockWindowUpdate", "uint", hw_TTOTAL_CMD)

TCPanelA := SendMessageTC(1074, 1000, 0, A) ; get active panel: 1=left, 2=right
hw_TCPathA := SendMessageTC(1074, 8+TCPanelA, 0, A)
ControlGetText, PathA,, % "ahk_id " hw_TCPathA

SendMessage, 1075, 2002,,, % "ahk_id " hw_TTOTAL_CMD

TCPanelA := SendMessageTC(1074, 1000, 0, A) ; active panel: 1=left, 2=right
TCItemsA := SendMessageTC(1074, 1002+TCPanelA, 0, A)
TCCaretA := SendMessageTC(1074, 1006+TCPanelA, 0, A)
TCUpDirA := SendMessageTC(1074, 1008+TCPanelA, 0, A)
TCFileA := SendMessageTC(1074, 1010+TCPanelA, 0, A) ;index of first file in list

if ( TCFileA = 4294967295 )
  TCFileA := TCItemsA

ControlGetText, PathA2,, % "ahk_id " hw_TCPathA
if ( PathA = PathA2 )
  Goto, Exit 

if ( NavMode = 1 )
  NextDir := TCCaretA = TCUpDirA ? TCFileA - TCUpDirA - 1 : TCCaretA - TCUpDirA - 1
else
  NextDir := TCFileA - TCCaretA > 1 ? TCCaretA + 1 - TCUpDirA : 0

SendMessage, 1075, 2049, % NextDir,, % "ahk_id " hw_TTOTAL_CMD
SendMessage, 1075, 1001,,, % "ahk_id " hw_TTOTAL_CMD

Exit:
DllCall("LockWindowUpdate", "uint", 0)
ExitApp

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
; Total Commander Send Message function            ;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
SendMessageTC(TCMsg, wParam, lParam, aControl)
{
  SendMessage, % TCMsg, % wParam, % lParam, % aControl, % "ahk_id " hw_TTOTAL_CMD
  return ErrorLevel
}
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
"I used to feel guilty in Cambridge that I spent all day playing games, while I was supposed to be doing mathematics. Then, when I discovered surreal numbers, I realized that playing games IS math." John Horton Conway
Post Reply