z-order是什么

原文来自:http://www.cppblog.com/zhcen/archive/2008/04/07/46420.aspx

Z-Order

The z-order of a window indicates the window's position in a stack of overlapping windows. This window stack is oriented along an imaginary axis, the z-axis, extending outward from the screen. The window at the top of the z-order overlaps all other windows. The window at the bottom of the z-order is overlapped by all other windows.

The system maintains the z-order in a single list. It adds windows to the z-order based on whether they are topmost windows, top-level windows, or child windows. A topmost window overlaps all other non-topmost windows, regardless of whether it is the active or foreground window. A topmost window has the WS_EX_TOPMOST style. All topmost windows appear in the z-order before any non-topmost windows. A child window is grouped with its parent in z-order.

When an application creates a window, the system puts it at the top of the z-order for windows of the same type. You can use the BringWindowToTop function to bring a window to the top of the z-order for windows of the same type. You can rearrange the z-order by using the SetWindowPos and DeferWindowPos functions.

The user changes the z-order by activating a different window. The system positions the active window at the top of the z-order for windows of the same type. When a window comes to the top of z-order, so do its child windows. 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.

译文:

窗口的z-order表明了在一堆堆叠的窗口中该窗口的位置。窗口的堆叠是沿着一条虚轴---Z轴,从屏幕里向外延伸的。在z-order顶端的窗口将会压在其他窗口上。在z-order底部的窗口将会被其他窗口所压。

系统在一个单一的表中维护z-order。根据窗口是不是顶级窗口,父窗口,子窗口,系统把他们添加到z-order中。顶级窗口将会堆叠在所有非顶级窗口之上,不管它是否是活动窗口或者是前台窗口。一个顶级窗口拥有WS_EX_TOPMOST的风格。在z-order中的所有的顶级窗口都会在任何非顶级窗口之前显现。一个子窗口会归入它父窗口的z-order中。

当一个应用程序创建一个窗口时,系统会把它放置在同一类窗口的z-order的顶部。你可以用BringWindowToTop函数将一个窗口置于同一类窗口的z-order的顶部。你可以通过SetWindowPosDeferWindowPos函数重新排序z-order

用户可以通过激活一个不同的窗口来改变z-order。活动的窗口会被系统放置在同类窗口的z-order的顶部。当一个窗口来到z-order的顶部,做自己的子窗口时。你可以用GetTopWindow函数去搜索父窗口的所有子窗口,并且返回一个指向z-order中最上边的子窗口的句柄。GetNextWindow函数可以检索句柄指向的下一个或前一个z-order中的窗口。

注:如有翻译不妥之处,敬请指出,共同学习,共同进步。谢谢

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值