NOTE: The package works currently only on Windows. Any pull request or issue is really appreciated.
Manage windows in Windows, macOS and Linux
To install this package, just run
$ npm install node-window-manager
The following example shows how to get the currently focused window's title and hide it.
const { windowManager } = require("window-manager");
const window = windowManager.getActiveWindow();
// Prints the currently focused window title.
console.log(window.getTitle());
// Hide the window.
window.hide();
x
numbery
numberwidth
numberheight
number
id
number - the process idname
string - the process file namepath
string - the process path
x
numbery
number
- Returns
Window
- Returns
Window
[]
- Returns
number
- the monitor handle.
- Returns
number
- the monitor scale factor.
- Returns
Point
- the mouse point.
Returns:
Window
Emitted when a window has been activated.
This class is similar to Electron's BrowserWindow
class.
handle
number - the window handleprocess
Process - the window owner process
- Returns
Rectangle
- Returns
Rectangle
Resizes and moves the window to the supplied bounds. Any properties that are not supplied will default to their current values.
window.setBounds({ height: 50 });
Resizes and moves the window content area to the supplied bounds. Any properties that are not supplied will default to their current values.
window.setContentBounds({ height: 50 });
- Returns
string
Shows the window.
Hides the window.
Minimizes the window.
Restores the window.
Maximizes the window.
Sets whether the window should show always on top of other windows.
Sets whether the window should be maximizable.
Sets whether the window should be minimizable.
Sets whether the window should be resizable.
Determines whether the window is maximizable.
Returns boolean
Determines whether the window is maximizable.
Returns boolean
Determines whether the window is resizable.
Returns boolean
Brings the window to top and focuses it.
opacity
- a value between 0 and 1.
Sets the window opacity.
Gets the window opacity
Returns number
between 0 and 1.