Skip to content

Enumerate application windows #1322

@dbwiddis

Description

@dbwiddis

We should add code to enumerate/iterate application/console windows on the "desktop" (or equivalent) of GUI-based operating systems.

On Windows, the EnumWindows() function is probably the best starting point, combined with EnumChildWindows. It's also possible to only use the child windows variant, starting with null.

On macOS, the Core Graphics API function CGWindowListCopyWindowInfo() is the best. I have written code to do this in this StackOverflow answer.

On *nix, there are probably X11 functions which are appropriate to use, but this will need research.

Important information to include in the "Window Handle" Object:

  • Window Title (if any)
  • Title of owning process (default for window title)
  • PID of owning process
  • Layer/Relationship (which window is on top: Z-Order on Windows)
  • Whether the window is visible
  • Window position and dimensions/bounds
  • Window transparency/alpha

Metadata

Metadata

Assignees

Labels

new featureSomething OSHI doesn't do now but could do

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions