09-18-2024, 05:50 PM
Use trigger parameter later. Also flag RunAtStartup may be useful.
Several "later" events can be used.
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;
}
};