[Convert] Z-order issues

Source: Internet
Author: User

Without overlapping windows, you do not need to care about Z-order. However, when the window overlaps, the system needs to use a standard to determine the display sequence of the window. This standard is Z-order. There are multiple factors that affect the Z-order of a window:

1. Whether the window type is topmost;

2. parent-child relationship between windows

System;

3. The owner relationship between windows;

4. Whether it is active.

 

The process for determining Z-order is as follows:

1. zorder of all topmost windows is higher than that of non-topmost windows;

2. The zorder of a top-level window is higher than the zorder of its owner;

3. The zorder of the child window is as high as the zorder of the parent window.

 

What is the top-level window?

A window that does not have the ws_child (ws_childwindow) style is a top-level window.

 

What is an owner relationship?

When creating a window, if ws_child is not specified or ws_child and ws_popup are both specified, the created window and hparent have a Owner Relationship. Hparent is the owner of the new window. It is worth noting that once the owner relationship is established, it cannot be changed.

 

What is a parent-child relationship?

Specify the ws_child style or use setparent to create a window.

 

Can the parent-child relationship coexist with the owner relationship?

Yes! Two methods are available: Specify ws_child and ws_popup at the same time when creating the window; do not specify ws_child when creating the window. After creation, add the ws_child style through modifystyle and call setparent to establish the parent-child relationship. When both windows have these two relations, the owner relationship is ignored. With this feature, a sub-window can be displayed in full screen mode.

 

Responsibilities and obligations arising from parent-child relationship

The child window can only be displayed in the client area of the parent window, the parent window is created before the child window, the Child Window is destroyed before the parent window, and the Child Window is invisible when the parent window is minimized or hidden.

 

Responsibilities and obligations arising from the Owner Relationship

The owner window is destroyed before it is destroyed. The owned window is invisible when the owner window is minimized. PS: when the owner window is hidden, the owned window is still visible.

Address: http://blog.csdn.net/lyclowlevel/article/details/7294980

[Convert] Z-order issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.