Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
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:
C++
SetWindowPos(&CWnd::wndBottom, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE | SWP_NOSENDCHANGING);


Any help is greatly appreciated.

Thanks,
Aravind B.
Posted
Updated 25-Nov-12 22:17pm
v2

1 solution

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.
 
Share this answer
 
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900