Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert Totalcmd minimize to tray script from QM to LA
#2
Code:
Copy      Help
// script "Totalcmd tray icon.cs"
/// On Keypress Ctrl+Alt+s adds tray icon and stays running. If Total Commander if not running runs and exits.

/*/ ifRunning run; /*/

var w = wnd.find(@"*Notepad++", "Notepad++", flags: WFlags.HiddenToo);
if (w.Is0) {
    run.it(@"C:\Program Files\Notepad++\notepad++.exe");
}
else if (w.IsVisible) {
    script.trayIcon(0,
        init: t => {
            t.Icon = icon.ofWindow(w);
            t.Tooltip = "Show Total Commander";
            t.Click += e => { timer.after(30, _ => w.Activate()); };
        }
    );

    w.Show(false);
    try { w.WaitFor(0, w => w.IsVisible); } catch { }
}
else {
    w.Activate();
}

To assign a trigger use menu TT > New trigger.


Messages In This Thread
RE: Convert Totalcmd minimize to tray script from QM to LA - by Gintaras - 06-24-2025, 08:33 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)