[WDX] Autorun Plugin: Run commands/set envvars on TC start

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
zhxeeaa
Junior Member
Junior Member
Posts: 50
Joined: 2016-12-10, 06:21 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *zhxeeaa »

Fla$her wrote: 2022-08-30, 19:26 UTC
zhxeeaa wrote: 2022-08-28, 19:17 UTCthe specified command?
Namely? What for? What goal are you pursuing?
Because some commands will fail when the Total CMD's window minimizing or loss of focus, and I am finding how to realize some functions like AHK's "If WinActive" in AUTORUN.
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

zhxeeaa wrote: 2022-08-31, 04:16 UTCBecause some commands will fail when the Total CMD's window minimizing or loss of focus, and I am finding how to realize some functions like AHK's "If WinActive" in AUTORUN.
Minimizing the window should not affect the execution of the code in any way, unless, of course, you are trying to simulate keystrokes in it.
But even in this case, knowing about the activity of TC window will not save you. You need look for another way.
Show your code better. Let's see what can be done.
Overquoting is evil! 👎
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Hacker »

Fla$her,
Minimizing makes it inactive. In that case one would need to use If WinExist.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

Hacker wrote: 2022-08-31, 13:55 UTCMinimizing makes it inactive. In that case one would need to use If WinExist.
No. Deactivation occurs only by activating another window, not otherwise.
Checking the existence here will not play any role at all.
Overquoting is evil! 👎
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Hacker »

Fla$her,
Deactivation occurs only by activating another window, not otherwise.
I have never observed such behavior.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

2Hacker
You observe this all the time when you switch between windows by Alt+Tab/Esc or click the mouse button to another window.
Overquoting is evil! 👎
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Hacker »

Fla$her,
Strange. Here no window gets minimized when I switch between windows by Alt+Tab/Esc or click the mouse button to another window.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

2Hacker
Nothing strange, it shouldn't collapse. Collapsing occurs when the WS_MINIMIZE flag is set. But the window doesn't cease to be active from this.
Overquoting is evil! 👎
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Hacker »

Fla$her,
Nothing strange, it shouldn't collapse.
When minimizing, the window shouldn't collapse?
Collapsing occurs when the WS_MINIMIZE flag is set.
Isn't that minimizing - which we're talking about?
the window doesn't cease to be active from this
The window remains active after one clicks the Minimize button?

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

Hacker wrote: 2022-08-31, 16:57 UTCWhen minimizing, the window shouldn't collapse?
Minimization = collapse. We talked about activation by Alt+Tab/Esc or mouse click.
Hacker wrote: 2022-08-31, 16:57 UTCIsn't that minimizing - which we're talking about?
See above.
Hacker wrote: 2022-08-31, 16:57 UTCThe window remains active after one clicks the Minimize button?
It's not about the window control, it's about the styles of the window at startup.
Run this .vbs:

Code: Select all

CreateObject("WScript.Shell").Run "notepad", 2
And immediately press Enter. The notepad window will be restored.
But if you change 2 to 7, the window of deactivation of the current window will not occur, i.e. Enter will work in it, not in Notepad.
I paid attention to this in relation to button option in TC.
Overquoting is evil! 👎
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Hacker »

Fla$her,
Minimization = collapse. We talked about activation by Alt+Tab/Esc or mouse click.
Huh? From the beginning we are talking about minimization:
zhxeeaa wrote:some commands will fail when the Total CMD's window minimizing or loss of focus
Fla$her wrote:Minimizing the window should not affect the execution of the code
Hacker wrote:Minimizing makes it inactive.
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

Hacker wrote: 2022-08-31, 18:11 UTC Huh? From the beginning we are talking about minimization:
It was about context:
Hacker wrote: 2022-08-31, 15:55 UTCHere no window gets minimized when I switch between windows by Alt+Tab/Esc or click the mouse button to another window.
Overquoting is evil! 👎
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Hacker »

Fla$her,
It seems to me that the conversation derailed here:
Hacker wrote:
Fla$her wrote:Deactivation occurs only by activating another window, not otherwise.
I have never observed such behavior.
I was saying that I have never observed focus only being lost by switching to another window and not by minimizing. From my experience a window always loses focus when minimized. However, it seems you misunderstood my point as me saying that I never saw a window lose focus by switching to another window.

Does this clear up the context?

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
zhxeeaa
Junior Member
Junior Member
Posts: 50
Joined: 2016-12-10, 06:21 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *zhxeeaa »

Hacker wrote: 2022-08-31, 19:36 UTC Fla$her,
It seems to me that the conversation derailed here:
Hacker wrote:
Fla$her wrote:Deactivation occurs only by activating another window, not otherwise.
I have never observed such behavior.
I was saying that I have never observed focus only being lost by switching to another window and not by minimizing. From my experience a window always loses focus when minimized. However, it seems you misunderstood my point as me saying that I never saw a window lose focus by switching to another window.

Does this clear up the context?

Roman
It should be related to the redrawing of the TC's window every time the window is switched.
I used a command to modify the title bar text of TC:
shellexec "%COMMANDER_PATH%\Addons\TCIMG\TCIMG.exe" "tityn=0 title=~~~~~~~~~~~~~~~~~~~~✿~~~~𝓣𝓒~~~~✿"
But it only works when the TC is started. When the window is switched, the title bar text returns to its original state. Fortunately, I found a sub-parameter of "TCIMG - title" to make it resident in memory to solve this problem:
shellexec "%COMMANDER_PATH%\Addons\TCIMG\TCIMG.exe" "tityn=0 title=~~~~~~~~~~~~~~~~~~~~✿~~~~𝓣𝓒~~~~✿||insystem<>"

I think this problem is the same as the fs2 of TCFS2 that I encountered before to hide the title bar and lose the Windows TaskBar.
Fla$her
Power Member
Power Member
Posts: 2297
Joined: 2020-01-18, 04:03 UTC

Re: [WDX] Autorun Plugin: Run commands/set envvars on TC start

Post by *Fla$her »

Hacker wrote: 2022-08-31, 19:36 UTCIt seems to me that the conversation derailed here:
Apparently so.
Hacker wrote: 2022-08-31, 19:36 UTCI was saying that I have never observed focus only being lost by switching to another window and not by minimizing.
Clearly.
Hacker wrote: 2022-08-31, 19:36 UTCFrom my experience a window always loses focus when minimized. However, it seems you misunderstood my point as me saying that I never saw a window lose focus by switching to another window.
That's exactly how I understood you. :)

2zhxeeaa
So they would write that the title should be changed. Then why check the activity? Just change in the loop:

Code: Select all

While 1
  ShellExec '%COMMANDER_PATH%\Utils\TCFS2\TCFS2.exe' '/ei "settext(`My HEADER`)"'
  Sleep 5000
Wend
zhxeeaa wrote: 2022-09-01, 12:23 UTCI think this problem is the same as the fs2 of TCFS2 that I encountered before to hide the title bar and lose the Windows TaskBar.
That's a whole other problem. See my answer below. I solved this problem a long time ago with AutoIt script for restoring the window when you move the mouse pointer to the upper left corner of the screen.
Overquoting is evil! 👎
Post Reply