I have option to use any one of the API EnumChildWindows or FindWindowEx.
Any suggestions which api is better performance oriented?
Is FindWindowEx internally uses EnumChildWindows to get handle to particular window?
This really depends a lot on your scenario.
The FindWindowEx function is used to search for windows having a particular class and optionally a particular piece of text in the window. The EnumChildWindows function is simply there to enumerate child windows.
I think performance should be your last concern here. The first is choosing the right API. If you are indeed searching for windows of a particular class then use FindWindowEx, otherwise EnumChildWindows. There is no sense in hand implementing a function using EnumChildWindows to have the same behavior as FindWindowEx.
Now after choosing the right solution, if a profiler specifically tells you that the solution is too slow, then you should consider hand implementing a more specific function. Not before.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With