我正在努力找到解决问题的方法-我正在开发一个Electron应用程序,我真的需要找到一种方法(使用JavaScript)来检测用户何时在最小化时从任务栏再次打开该应用程序。任何帮助表示赞赏!
const remote = require('electron').remote;
document.getElementById("minApp").addEventListener("click", function (e) {
document.getElementById('minApp').style.opacity = '0.55';
document.getElementById('minApp').onmouseover = function() {
document.getElementById('minApp').style.opacity = '0.55';
}
document.getElementById('minApp').onmouseout = function() {
document.getElementById('minApp').style.opacity = '0.55';
}
var window = remote.getCurrentWindow();
window.minimize();
});
document.getElementById("closeApp").addEventListener("click", function (e) {
var window = remote.getCurrentWindow();
window.close();
});
var window = remote.getCurrentWindow();
window.on('restore', () => {
document.getElementById('minApp').style.opacity = '0.55';
document.getElementById('minApp').onmouseover = function() {
document.getElementById('minApp').style.opacity = '1';
}
document.getElementById('minApp').onmouseout = function() {
document.getElementById('minApp').style.opacity = '0.55';
}
alert(1);
})