electron v 1.7.9
(11.18 최신 릴리즈 기준)
// Get module to need
import { app, screen, BrowserWindow, etc... } from 'electron'
app.on('[STATUS]', () => {
// *** CODE *** //
})
사용자가 사용하는 디스플레이의 정보를 출력한다. screen 모듈은 1개 이상의 디스플레이 정보를 반환할 수 있다.
// *** CODE *** //
const display = screen.getAllDisplays()[0]
console.log(display);
// *** CONSOLE RESULT *** //
{ id: 69733312,
bounds: { x: 0, y: 0, width: 1920, height: 1200 },
workArea: { x: 0, y: 23, width: 1920, height: 1101 },
size: { width: 1920, height: 1200 },
workAreaSize: { width: 1920, height: 1101 },
scaleFactor: 2,
rotation: 0,
touchSupport: 'unknown' }
const display = screen.getAllDisplays()[0]
const {x,y,width,height} = display.bounds;
const win = new BrowserWindow({
frame : false,
transparent : true,
alwaysOnTop : true,
x, y, width, height
})