Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trigger for Minimizing a Window
#1
Is there a way to create a trigger when minimizing a window?

It seems that Window trigger events are geared towards new, activated, and visibility, but I don't see where I can create a trigger when minimizing a specific window.

Thanks!
#2
Use trigger parameter later. Also flag RunAtStartup may be useful.

Code:
Copy      Help
        Triggers.Window[TWEvent.VisibleOnce, cn: "Notepad", flags: TWFlags.RunAtStartup, later: TWLater.Minimized] = o => {
            if (o.Later == TWLater.Minimized) {
                print.it("minimized");
            }
else {
                print.it("visible");
            }
        };

Several "later" events can be used.
Code:
Copy      Help
        Triggers.Window[TWEvent.VisibleOnce, cn: "Notepad", flags: TWFlags.RunAtStartup, later: TWLater.Minimized | TWLater.Unminimized | TWLater.Destroyed] = o => {
            switch (o.Later) {
            case 0:
                print.it("visible");
                break;
            case TWLater.Minimized:
                print.it("minimized");
                break;
            case TWLater.Unminimized:
                print.it("unminimized");
                break;
            case TWLater.Destroyed:
                print.it("destroyed");
                break;
            }
        };
#3
This works!

Thank you!


Forum Jump:


Users browsing this thread: 1 Guest(s)