node-window-manager icon indicating copy to clipboard operation
node-window-manager copied to clipboard

window.isVisible() always returns true

Open arejaycola opened this issue 5 years ago • 3 comments

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:

  • Operating System: Windows 10
  • node-window-manager version: 2.0.1
  • Last known working node-window-manager version:

Additional context

arejaycola avatar Feb 27 '20 18:02 arejaycola

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

sentialx avatar Mar 07 '20 12:03 sentialx

@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

xland avatar Jun 30 '20 03:06 xland

@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

nodgear avatar Nov 23 '21 05:11 nodgear