sentialx / node-window-manager

Manage windows in Windows, macOS and Linux using Node.js
MIT License
402 stars 58 forks source link

window.isVisible() always returns true #40

Open arejaycola opened 4 years ago

arejaycola commented 4 years ago

Bug description Calling window.isVisible() returns true for every process that is running. Claims that every window is visible.

To Reproduce windowManager.getWindows().forEach((window) => { if (window.isVisible()) { console.log(window.path); } });

Expected behavior Should only return true if window is visible.

Screenshots

image

Details:

Additional context

sentialx commented 4 years ago

@arejaycola It just checks whether a window has the WS_VISIBLE attribute, according to the WinAPI docs

xland commented 4 years ago

@sentialx Such these windows is not visible, but the isVisible api return true

C:\Windows\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy\SearchUI.exe
C:\Windows\SystemApps\ShellExperienceHost_cw5n1h2txyewy\ShellExperienceHost.exe
nodgear commented 2 years ago

@sentialx Such these windows is not visible, but the isVisible api return true

C:\Windows\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy\SearchUI.exe
C:\Windows\SystemApps\ShellExperienceHost_cw5n1h2txyewy\ShellExperienceHost.exe

Those are cloaked windows, they return as visible for win32 api because.... Microsoft. what you have to do is check if they are cloaked before checking if they are visible use NAPI FFI for that