Solved

How to cascade modal windows?

Posted on 2000-03-06
3
360 Views
Last Modified: 2013-11-20
I have modal window that can open another modal window of the same class, and it is "nested" one in the other (you can nest many levels). I would like it to show cascaded, and use CascadeWindows in the child:
*the parent send its handle before the DoModal and the child, in OnInitDialog calls:

int result = CascadeWindows(_hParentHandle, 0, NULL, 0, NULL);
it doesn't work with the child's handle pointer either:
HWND* pHandles;
pHandles = &m_hWnd;
int result = CascadeWindows(_hParentHandle, 0, NULL, 1, pHandles);

Thanks!
0
Comment
Question by:talia
  • 2
3 Comments
 
LVL 31

Expert Comment

by:Zoppo
ID: 2587002
Hi talia,

since you say you're using DoModal I assume your 'child' windows do not have thw WS_CHILD style set.

Unforunately I think CascadeWindows() only affect windows with the WS_CHILD style set (I even do not exactly know if it only works for MDI child windows).

ZOPPO
0
 
LVL 31

Accepted Solution

by:
Zoppo earned 100 total points
ID: 2587052
BTW, you can try to use CWnd::GetWindow() to get the sibling windows to your first dialog and CWnd::MoveWindow() to position them where you want. This way you could simulate CascadeWindows()

hope that helps,

ZOPPO
0
 

Author Comment

by:talia
ID: 2594846
Thanks , It works.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now