Solved

How to make a modeless dialog stay on top

Posted on 1998-06-12
3
532 Views
Last Modified: 2013-11-20
I have a modeless dialog box.  I need this dialog box to stay on top of all applications.  How do I do this in MFC?  Can this option be set/changed at runtime.
0
Comment
Question by:edhill
[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
3 Comments
 
LVL 3

Expert Comment

by:shaig
ID: 1317914
Yes. you can make the window a TOPMOST one in the OnInitDialog() function of the modal dialig.
0
 

Author Comment

by:edhill
ID: 1317915
Can this option be changed at runtime.  I know that some applications have a menu selection called always on top that you can check and uncheck according to your needs.

Also is the SetWindowPosition the only function that can do this.  I really do not want to change the current location of my modeless dialog box.
0
 
LVL 3

Accepted Solution

by:
shaig earned 270 total points
ID: 1317916
My answer is correct, you are now asking something else.
for doing what you described, just send some WM_ message of your own to the modal dialog ( from within a menu command handler for example - note that modal operation isn't so apropriet for that ). the handler in the dialog for the WM_ message will call  SetWindowPosition and then, vewalla:
the the window can be topmost at any givven time at your request.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
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.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

717 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