开发者

Is a control tree cached after the first call to FindWindowEx/EnumChildWindows?

开发者 https://www.devze.com 2022-12-25 08:16 出处:网络
I noticed that if you call FindWindowEx or EnumChildWindows against a hWnd that belongs to a window that\'s not in the foreground, i.e. minimized, then they don\'t report any children. On the other ha

I noticed that if you call FindWindowEx or EnumChildWindows against a hWnd that belongs to a window that's not in the foreground, i.e. minimized, then they don't report any children. On the other hand if I first call SetForegroundWindow against the window I'm querying, and after that FindWindowEx or EnumChildWindows, they report all the children. Next calls report all the children even if the window I'm interested in is not in foreground. It's almost it doe开发者_如何学Pythons some sort of caching after the first call?


Is this a window in your own application, or are you investigating what a third-party application does?

I would guess that the application only creates its child windows the first time it is brought into the foreground; this would explain the behaviour you are seeing. To my knowledge, EnumChildWindows does not perform any caching.

0

精彩评论

暂无评论...
验证码 换一张
取 消