Package Exports
- win32-monitor-window-resize
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (win32-monitor-window-resize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-win32-hook-window-resize
Notify when any window resizes/moves, based on Win32 APIs.
Example
const ResizeMonitor = require("win32-hook-window-resize").ResizeMonitor;
const wh = new ResizeMonitor(parseInt(process.argv[2]));
wh.on("resize", rect => {
console.log(rect);
});
API
ResizeMonitor(pid: number)
The constructor.
Params
pid
- Process ID
Throws
- RangeError if process id is invalid
Note
Process ID can be specified to zero, under which the hooker monitors ALL window resizing, which can be a huge decrease of system performance.
kill(): void
Kill the worker process, stops monitoring.
on(event: "resize", listener: (rect: WindowRect) => void): this
Specify callback function when the specific window(s) resizes/moves.
Params
event
- Must be "resize"listener
- The callback function
WindowRect
{
pid: number; // process ID
left: number; // left border position
top: number; // top border position
right: number; // right border position
bottom: number; // bottom border position
}
License
MIT