如何获得Z顺序的窗口? [英] How to get the z-order in windows?
问题描述
我在做,我有每个正在运行的应用程序交互的应用程序。现在,我需要得到窗口的z顺序的一种方式。例如,如果Firefox和记事本运行,我需要知道哪一个是在前面。
I'm making an application where I interact with each running application. Right now, I need a way of getting the window's z-order. For instance, if Firefox and notepad are running, I need to know which one is in front.
任何想法?除了这样做的每个应用程序的主窗口,我也需要做为其子和妹妹窗口(窗口属于同一进程)。
Any ideas? Besides doing this for each application's main window I also need to do it for its child and sister windows (windows belonging to the same process).
推荐答案
您可以使用GetTopWindow功能来搜索父窗口的所有子窗口,并返回一个句柄子窗口是最高的Z顺序。该GetNextWindow函数检索句柄到Z顺序下一个或previous窗口。
You can use the GetTopWindow function to search all child windows of a parent window and return a handle to the child window that is highest in z-order. The GetNextWindow function retrieves a handle to the next or previous window in z-order.
GetTopWindow:<一href="http://msdn.microsoft.com/en-us/library/ms633514(VS.85).aspx">http://msdn.microsoft.com/en-us/library/ms633514(VS.85).aspx
GetNextWindow:<一href="http://msdn.microsoft.com/en-us/library/ms633509(VS.85).aspx">http://msdn.microsoft.com/en-us/library/ms633509(VS.85).aspx
GetTopWindow: http://msdn.microsoft.com/en-us/library/ms633514(VS.85).aspx
GetNextWindow: http://msdn.microsoft.com/en-us/library/ms633509(VS.85).aspx
这篇关于如何获得Z顺序的窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!