EnumChildWindows或FindWindowEx? [英] EnumChildWindows or FindWindowEx?

查看:787
本文介绍了EnumChildWindows或FindWindowEx?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以选择使用任何一个API EnumChildWindows或FindWindowEx。

I have option to use any one of the API EnumChildWindows or FindWindowEx.

任何建议哪些api是更好的性能导向?

Any suggestions which api is better performance oriented?

FindWindowEx在内部使用EnumChildWindows来获取特定窗口的句柄?

Is FindWindowEx internally uses EnumChildWindows to get handle to particular window?

推荐答案

场景。

FindWindowEx函数用于在窗口中搜索具有特定类和可选特定文本的窗口。 EnumChildWindows函数就是枚举子窗口。

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.

我认为表现应该是你最后关注的问题。第一个是选择正确的API。如果你确实搜索特定类的窗口,然后使用FindWindowEx,否则EnumChildWindows。没有任何意义在手实现一个函数使用EnumChildWindows具有与FindWindowEx相同的行为。

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.

现在选择正确的解决方案后,如果profiler明确告诉您解决方案太慢,那么您应该考虑手动实现更具体的功能。在此之前。

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.

这篇关于EnumChildWindows或FindWindowEx?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆