Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EnumChildWindows or FindWindowEx?

Tags:

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?

like image 826
anand Avatar asked Dec 01 '09 02:12

anand


1 Answers

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.

like image 174
JaredPar Avatar answered Oct 13 '22 01:10

JaredPar