Maximize (set active) or minimize TC with a unique keyboard shortcut

English support forum

Moderators: white, Hacker, petermad, Stefan2

DjobyDjoba
Junior Member
Junior Member
Posts: 52
Joined: 2006-10-23, 09:46 UTC

Maximize (set active) or minimize TC with a unique keyboard shortcut

Post by *DjobyDjoba »

Hi,

I want a keyboard shortcut with this behavior:

- When TC is active (foremost), minimize it.
- When TC is inactive / minimized, make it active/ maximized

How can this can be achieved?

Thanks.
Last edited by DjobyDjoba on 2020-11-30, 16:02 UTC, edited 1 time in total.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: A shortcut to toogle between activate (restore) TC <-> minimize it.

Post by *Horst.Epp »

Why a shortcut ?
Clicking on the TC Symbol in the task bar does it
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
DjobyDjoba
Junior Member
Junior Member
Posts: 52
Joined: 2006-10-23, 09:46 UTC

Re: A shortcut to toogle between activate (restore) TC <-> minimize it.

Post by *DjobyDjoba »

Why we prefer keyboard shortcuts to mouse movements sometimes? (Ctrl+tab instead of clicking in the task bar...). :wink:

For the fastest control, I want a shorcut to maximize TC when I need it, and the same shortcut to minimize it when the work with TC is done.

FYI, the shortcut I wand to use is Ctrl+2 (the square key, this key never used just above the tab key and below the Esc key, French keyboard layout). A very handy shortcut we can use even without thinking of it.

Some programs have implemented such a maximize/minimize shortcut. Seems TC has not? Would be very handy.
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: A shortcut to toogle between activate (restore) TC <-> minimize it.

Post by *gdpr deleted 6 »

As far as i remember, TC itself doesn't offer such a function. I guess you would need to write a program/script to realize this. AutoHotkey should probably offer the necessary feature set to write such a script.


(With regard to a native TC implementation: While i can envision the minimizing part of such a feature to work just fine, the part of the feature that is supposed to restore/active a TC window is a real head-scratcher to me. Considering that TC is not a natural singleton application, there will be situations where one TC instance is minimized and another inactive TC instance is lurking behind some other application window. How would an implementation of the feature be able to figure out correctly which of the two TC instances the user actually wants to active? :? )
Last edited by gdpr deleted 6 on 2020-11-29, 18:56 UTC, edited 1 time in total.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: A shortcut to toogle between activate (restore) TC <-> minimize it.

Post by *Horst.Epp »

DjobyDjoba wrote: 2020-11-29, 18:30 UTC Why we prefer keyboard shortcuts to mouse movements sometimes? (Ctrl+tab instead of clicking in the task bar...). :wink:

For the fastest control, I want a shorcut to maximize TC when I need it, and the same shortcut to minimize it when the work with TC is done.

FYI, the shortcut I wand to use is Ctrl+2 (the square key, this key never used just above the tab key and below the Esc key, French keyboard layout). A very handy shortcut we can use even without thinking of it.

Some programs have implemented such a maximize/minimize shortcut. Seems TC has not? Would be very handy.
You can assign hotkeys to the commands cm_Maximize and cm_Minimize but there is no toggle.
A toogle can be made using an Autohotkey script.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
DjobyDjoba
Junior Member
Junior Member
Posts: 52
Joined: 2006-10-23, 09:46 UTC

Re: A shortcut to toogle between activate (restore) TC <-> minimize it.

Post by *DjobyDjoba »

cm_Maximize only works when TC is already active... Not even useful.

Not to even mention the toogle feature, it seems that TC has not implemented a global hotkey to restore TC window when minimized. Global hotkey = effective on the entire system, and outside of TC too. This lack is quite astounding for a major system program like a file manager!

Yes, I've tried with AutoHotkey but I ran into an issue with the WinActivate command. It gives an unwanted result with TC: for a reason TC cycles through the next tab when WinActivate is used on it... I'm not an AutoHotkey expert, if someone has a working script to share...

But for this it should be a built-in feature... I use the task manager program ToDoList (by AbstractSpoon), awesome program by the way (and free!), and it has this global hotkey that toogles maximize/minimize (in the Preferences > General, you can set it there). So handy... And it's a portable app, so it should be feasible in TC too with no problem.
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: A shortcut to toogle between activate (restore) TC <-> minimize it.

Post by *gdpr deleted 6 »

DjobyDjoba wrote: 2020-11-29, 19:48 UTC I use the task manager program ToDoList (by AbstractSpoon), awesome program by the way (and free!), and it has this global hotkey that toogles maximize/minimize.
Let me guess, ToDoList is a single-instance application, or?
DjobyDjoba
Junior Member
Junior Member
Posts: 52
Joined: 2006-10-23, 09:46 UTC

Re: A shortcut to toogle between activate (restore) TC <-> minimize it.

Post by *DjobyDjoba »

Yes it is. As TC, no?
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: A shortcut to toogle between activate (restore) TC <-> minimize it.

Post by *gdpr deleted 6 »

DjobyDjoba wrote: 2020-11-29, 19:54 UTC Yes it is. As TC, no?
No, see my first comment (the part in the parantheses). It's the situation where a user has multiple TC intances running, and two or more of them being minimized or behind some other application window. How is the restore function supposed to to know which TC instance the user wants to restore/activate without reading the users mind?

Hence, your best shot would be to write a script that reflects and is tailored to how you specifically use TC.


(Just as a side note: You can use TC kinda like a single-instance application. However, it is not TC enforcing single-instance application, but a commandline option that would have to be provided for each and every invocation of the TC executable. If you forget to provide this commandline option just once or deliberately omit it, blam!, another TC instance will start up. Thus, even though you can setup your environment in a way where TC appears to behave like a single-instance application, it is not really one...)
DjobyDjoba
Junior Member
Junior Member
Posts: 52
Joined: 2006-10-23, 09:46 UTC

Re: A shortcut to toogle between activate (restore) TC <-> minimize it.

Post by *DjobyDjoba »

Your best shot would be to write a script that reflects and tailored to how you use TC.
Yes, I think that too... WinActivate command is bogus with Autohotkey, AHK is not anymore the easy thing it was in the past, because many commands don't work in a straightforward manner anymore (my experience).

What percentage of TC users work with several instances? I'm curious about that. One of the first thing I had done is to activate the "Only one instance" option. The request for such a global hotkey is perfectly legitimate, because most of TC users work with only one instance. And even with multi-instances, the behavior of a global hotkey would not be a problem (apply it to the first TC window found, and if the user is not happy so he is not forced to use the global hotkey!)

So consider this thread as a feedback / suggestion for a new feature.

Now, I'm going to work on a script... :(
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: A shortcut to toogle between activate (restore) TC <-> minimize it.

Post by *gdpr deleted 6 »

Come to think of it... perhaps there might be a way using a Windows shortcut.
Try creating a shortcut (.lnk file) for TC where the TC executable is invoked using the /O parameter and assign a hotkey to the shortcut. /O instructs this invoaction of TC's executable to activate an existing TC instance; only if there is no existing TC instance it will start up a new TC instance. (I guess the shortcut has to be on the desktop and/or in the start menu for the hotkey to work, but i might be mistaken)

Then, inside TC, assign the same hotkey for cm_minimize.

I am not sure that this works (i did not test, it just came to my mind), but might be worth to try.


Since you asked, i for example work frequently with 2 TC instances. Sure, the workflows i do can be in some way or another also be realized within a single instances, but Alt+Tab is so darn convenient ;) Rarely i run 3 instances, but that's where usually one of them is running elevated for various reasons. It's hard to give a percentage that's not pulled out of someone's nose, but given the fact that TC is not a single-instance application, there will be users who run multiple instances in parallel.

DjobyDjoba wrote: 2020-11-29, 20:20 UTC [...] because most of TC users work with only one instance. [...]
Well, that very much looks like something that has been pulled out of somebodys nose, wouldn't you say? ;)
Last edited by gdpr deleted 6 on 2020-11-29, 20:35 UTC, edited 1 time in total.
NotNull
Senior Member
Senior Member
Posts: 266
Joined: 2019-11-25, 20:43 UTC
Location: NL

Re: A shortcut to toogle between activate (restore) TC <-> minimize it.

Post by *NotNull »

Method 1 : existing Windows functionality

- Pin Total Commander to the taskbar, let's say it's the 3rd pinned icon
- Press WIN+3 to toggle minimized / last state


Method 2: AHK

- Replace WIN+N with your actual keyboard shortcut (I have a different keyboard layout
- Replace WinMaximize with WinActivate to restore the previous sindow size

Code: Select all

#SingleInstance FORCE

#n::
{
	IfWinActive ahk_class TTOTAL_CMD
	{
		WinMinimize ahk_class TTOTAL_CMD
		return
	}
	IfWinNotActive ahk_class TTOTAL_CMD
	{
		WinMaximize ahk_class TTOTAL_CMD
		return
	}
}
return

Last edited by NotNull on 2020-11-29, 20:38 UTC, edited 1 time in total.
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: A shortcut to toogle between activate (restore) TC <-> minimize it.

Post by *gdpr deleted 6 »

NotNull wrote: 2020-11-29, 20:34 UTC Method 1 : existing Windows functionality

- Pin Total Commander to the taskbar, let's say it's the 3rd pinned icon
- Press WIN+3 to toggle minimized / last state
Damn, i am going to eat a broomstick!
Why didn't i know of it? And it even plays gracefully with multiple instances :)
NotNull
Senior Member
Senior Member
Posts: 266
Joined: 2019-11-25, 20:43 UTC
Location: NL

Re: A shortcut to toogle between activate (restore) TC <-> minimize it.

Post by *NotNull »

elgonzo wrote: 2020-11-29, 20:36 UTC Damn, i am going to eat a broomstick!
Why didn't i know of it? And it even plays gracefully with multiple instances :)
The icons don't even need to be pinned, but if you always want to use the same shortcut ..
DjobyDjoba
Junior Member
Junior Member
Posts: 52
Joined: 2006-10-23, 09:46 UTC

Re: A shortcut to toogle between activate (restore) TC <-> minimize it.

Post by *DjobyDjoba »

NotNull wrote: Method 1 : existing Windows functionality

- Pin Total Commander to the taskbar, let's say it's the 3rd pinned icon
- Press WIN+3 to toggle minimized / last state
Ouchhh! I missed this one... That is handy!!
AHK script works well too... Not a surprise I'm bad at scripting.

Thanks much!! I'll probably stick with the Win+3 solution.

elgonzo wrote:Sure, the workflows i do can be in some way or another also be realized within a single instances, but Alt+Tab is so darn convenient
For me the cons of multiple instances management exceed the pro. My brain is not multitasking (that is unfortunate).

Thanks mates.
Post Reply