sentialx / node-window-manager

Manage windows in Windows, macOS and Linux using Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getWindows returns only one window from the system (0.7.0 npm package)

montesk21 opened this issue · comments

Hello!
We are experiencing the issue with method from the npm package node-window-manager. Method getWindows() from dist/index.js does not return all windows but the first in the system. Our purpose is to find certain window via known process id.

As for now we fixed it directly in the package by adding return true in the ffi.Callback like so

this.getWindows = () => {
const windows = [];
const callback = ffi.Callback("bool", ["int64", "int64"], (hwnd, lParam) => {
windows.push(new window_1.Window(hwnd));
return true // this line was modified
});
windows_1.user32.EnumWindows(callback, 0);
return windows;
};

Is it possible to update the npm package (include the method in newer versions)? I also saw getWindows is not supported in latest version