Solved

How to make a modeless dialog stay on top

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Tab names are off by one 5 54
scoreUp challenge 14 63
How to convert MFC::CString to UTF8 wchar_t* 10 211
JQuery serialize and unserialize 8 85
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. …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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 a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

777 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