Posts: 4
Threads: 3
Joined: Nov 2020
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!
Posts: 12,086
Threads: 142
Joined: Dec 2002
Use trigger parameter
later. Also flag
RunAtStartup may be useful.
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.
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;
}
};
Posts: 4
Threads: 3
Joined: Nov 2020