?
Solved

How to make a CMDIChildWnd pop-up?

Posted on 1998-05-12
4
Medium Priority
?
393 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
piano_boxer earned 200 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month8 days, 16 hours left to enroll

765 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