Click here to Skip to main content
12,953,937 members (42,443 online)
Rate this:
Please Sign up or sign in to vote.
See more:

I have a need to change the Z order of a popup dialog within a application, which has both child & other popup dialogs. The application consists of multiple POPUP & one CHILD dialog under a view. After a user action, i need to change the Z order of one of the Popup dialogs and send it behind all the existing dialogs (including the child dialog).

The issue i am facing is the popup dialog is not going behind Child dialog (while is it going behind rest of the popup dialogs of the app as expected). Changing the style of the only Child dialog to popup is not an option for me. Can we not place a popup dialog behind a child?

Following code is used to change the Z Order:

Any help is greatly appreciated.

Aravind B.
Posted 25-Nov-12 22:14pm
Updated 25-Nov-12 22:17pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I think you cannot achieve this.

The following is from the remark section of the SetWindowPos[^]:
Quote SetWindowPos[^]:
A non-topmost window can own a topmost window, but the reverse cannot occur. Any window (for example, a dialog box) owned by a topmost window is itself made a topmost window, to ensure that all owned windows stay above their owner.
As your pop up is owned by the child dialog it cannot be hidden behind it.
Aravind Badrinath Krishnan 26-Nov-12 5:43am
Thanks for the response.
In my case the pop up dialog i am trying to push down the Z Order is not owned by the Child dialog. The pop up window and the child dialog both are siblings of the same view. The issue here is that SetWindowPos does not push the popup dialog below a child dialog, which is owned by the view.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,464
CHill60 3,490
Maciej Los 3,123
ppolymorphe 2,020
Jochen Arndt 1,975

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 26 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100