Solved

How to make a modeless dialog stay on top

Posted on 1998-06-12
3
530 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
  • 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

Suggested Solutions

Title # Comments Views Activity
fix34  challenge 9 147
unix example issues 18 100
how to split multiple lines delimiter : 8 112
x-bar in Google Sheets 2 72
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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.

821 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