Files
part2/yzg.js
2023-01-19 00:33:33 +08:00

30 lines
503 B
JavaScript

let electron = require('electron');
let allWindow = {};
function init(win){
let id = win.id;
allWindow[id] = win;
// win.webContents.openDevTools();
win.once('ready-to-show', () => {
// win.webContents.openDevTools();
win.webContents.send('init_win_id', id);
win.show()
});
return id;
}
function close(id){
delete allWindow[id];
}
function get(id){
return allWindow[id];
}
module.exports = {
init: init,
get: get,
close: close
};