Solved

How to make a CMDIChildWnd pop-up?

Posted on 1998-05-12
4
375 Views
Last Modified: 2013-11-20
My application has one doc and two views. One view is used to display picture in normal size and the other view is used to display the same but zoomed picture. I hope the latter view can keep TOPMOST. But since the CMDIChildWnd cann't have a WS_POPUP style, how should I do? Thanks!
0
Comment
Question by:zhpch
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
piano_boxer earned 100 total points
ID: 1309944
You need to create a new frame window class for the view. CMDIChildWnd is only designed to be a child of the main app-window.

Derive a new frame class from CMiniFrameWnd. Override PreCreateWindow of it:

BOOL CTopFrame::PreCreateWindow(CREATESTRUCT& cs)
{
    cs.dwExStyle |= WS_EX_TOPMOST;      
    return CMiniFrameWnd::PreCreateWindow(cs);
}

Theres is some problems to solve:
 1. The frame does not activate correct.
 2. There is a seperate menu in the top-most frame.
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1309945
Your override is incorrect.  You should code:

BOOL CTopFrame::PreCreateWindow(CREATESTRUCT& cs)
{
   if (!CMiniFrameWnd::PreCreateWinodw(cs))
      return FALSE;

   cs.dwExStyle |= WS_EX_TOPMOST;
   return TRUE;
}

.B ekiM

0
 
LVL 4

Expert Comment

by:piano_boxer
ID: 1309946
mikeblas: Hmmm. What I did works, but OK.
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1309947

works != correct


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: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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 tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

863 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