How to make a modeless dialog stay on top

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.
Who is Participating?
shaigConnect With a Mentor Commented:
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.
Yes. you can make the window a TOPMOST one in the OnInitDialog() function of the modal dialig.
edhillAuthor Commented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.