Solved

How to make a CMDIChildWnd pop-up?

Posted on 1998-05-12
4
369 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa‚Ķ
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.

743 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

10 Experts available now in Live!

Get 1:1 Help Now