Why is EnumChildWindows skipping children?

前端 未结 1 1301
后悔当初
后悔当初 2020-12-10 04:47

I\'m getting strange behavior when it comes to using the Windows API method EnumChildWindows. It seems to not be picking up a section of children windows. When I drill down

相关标签:
1条回答
  • 2020-12-10 05:43

    Doh! I discovered the errors of my ways. The reason why I was only getting half of the children was due to the fact I was not waiting long enough for the window to initially load and create ALL of the children within it, therefore I was only getting the first half that it created at the time I was calling my function to obtain all child windows. So I added a line of code to sleep before calling EnumChildWindows().

    "Windows does not call the callback function for any child windows created after EnumChildWindows is called but before it returns." - Source

    The above quoted piece of information is what turned the light-bulb on in my head.

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