问题
win.flashFrame()
makes tray icon flash until the icon is clicked and the app window is back in the focus again (on Windows 10)
However, if the app is minimized, the flashing ends automatically after just a couple of seconds without even clicking on the icon.
How can I prevent this?
回答1:
If the window is minimized the user won't see the window flash, you will need to use the win.setProgressBar funciton. This will make a loading bar behind the icon in the tray, you can also set the mode of the progress bar to indeterminate
and set the progress to 100%
and it will flash yellow/orange. This is a general standard used by lots of applications to get a users attention when the app is minimized.
win.setProgressBar(1, {
mode: "indeterminate"
});
来源:https://stackoverflow.com/questions/45504387/electron-win-flashframe-method-when-app-is-minimized