Solved

How to make a modeless dialog stay on top

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

22 Experts available now in Live!

Get 1:1 Help Now