似乎在枚举窗口的时候很多人都会提到,GetWindow与EnumChildWindows,但是后者真的除了比前者还稳定外,就真的没有什么区别了吗???
在我的开发过程中发觉并不如此,简单的就是,我用EnumChildWindows真的能把所有的窗口都枚举出来,但是GetWindow就不行了.以观看CHM文件为例,我就不能成功.不知道大家有没有遇到过这样的问题呢?
因为本人最近在写一个用手柄控制鼠标行为的程序,嘻嘻,有点模拟EASYMOUSE的.但是本人想更快地定位到子窗口中,本来我的做法是用ChildWindowFromPoint再用GetWindow取处上一下或者是下一个子窗口的,但是因为其不能正确取得信息,拟搞得我现在不知道要怎么办才好:(((((((((((((((((

解决方案 »

  1.   

    Should be different; otherwise one of them needn't exist, right?
    Suggestion: Refer to MSDN, check the definition of the two functions.
      

  2.   

    The EnumChildWindows function is more reliable than calling GetWindow in a loop. An application that calls GetWindow to perform this task risks being caught in an infinite loop or referencing a handle to a window that has been destroyed.EnumChildWindow不能得到正在被创建或被destroy的窗口。