Solved

How to cascade modal windows?

Posted on 2000-03-06
3
350 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 30

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 30

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 47
Tab names are off by one 5 49
if loop in java 3 114
NotAlone Challenge 20 72
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

746 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

12 Experts available now in Live!

Get 1:1 Help Now