Issue with EnumWindows

后端 未结 2 953
天涯浪人
天涯浪人 2020-12-18 17:08

When enumerating windows using EnumWindows, I get hundreds of handles instead of one per open window on my desktop.

First of all, i am curious if this is the correc

相关标签:
2条回答
  • 2020-12-18 17:34

    To get the main window of a process, use the Process.MainWindowHandle property.

    To answer your question, you can see exactly what all of the handles are using Spy++.
    In short, many applications will create hidden windows to run message loops.

    0 讨论(0)
  • 2020-12-18 17:49

    You can filter within the enum callback by checking IsWindowVisible() & ignoring invisible system/message sink windows.

    0 讨论(0)
提交回复
热议问题