很多人以为EnumWindows足以枚举出系统所有的窗口,错!它只能枚举出顶层的窗口。MSDN原文:Enumerates all top-level windows on the screen by passing the handle to each window.
有个函数叫做EnumThreadWindows,很多人也会认为,这应该可以枚举出某个线程的所有窗口了吧?错!它只能枚举出“非子窗口”。MSDN原文:Enumerates all nonchild windows associated with a thread by passing the handle to each window.
还有一个函数叫做EnumChildWindows,貌似这货才能枚举出一个顶层窗口之下的所有窗口。MSDN原文:Enumerates the child windows that belong to the specified parent window by passing the handle to each child window.