Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 155123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:05:59+00:00 2026-05-11T10:05:59+00:00

Is there a way to create a modeless dialog box in C++ MFC which

  • 0

Is there a way to create a modeless dialog box in C++ MFC which always stays on top of the other windows in the application? I’m thinking sort of like the Find dialog in Visual Studio 2005 – where it stays on top, but you can still edit the underlying text.

(If it makes any difference, it’s not MDI; it’s a dialog-based app)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:06:00+00:00Added an answer on May 11, 2026 at 10:06 am

    Note: This does not work under Windows 10, and may not work under Windows 7 and 8 (Reports vary).

    From Nish:

    ###Making your dialog stay on top

    Haven’t you seen programs which have an "always-stay-on-top" option? Well the unbelievable thing is that you can make your dialog stay on top with just one line of code. Simply put the following line in your dialog class’s OnInitDialog() function.

    SetWindowPos(&this->wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); 

    Basically what we are doing is to use the SetWindowPos function to change the Z-order of our dialog window. We make our dialog stay on top of all other windows by moving it to the top of the Z-order. Now even when you activate some other window, our window will stay on top. But I’d advise you to make sure you know exactly what you are doing when you do this, for it might annoy people if they can’t get your window out of the way when they want to do that.

    As you mentioned in the comments, the above line makes the window sit on top of every application. You’ll need to do

    SetWindowPos(&this->wndTop,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); 

    To make a window sit on top of only your application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to create a dialog box or control bar, it always
Is there any way to create a modeless child window on a Silverlight application?
Is there any way to create a Windows 8 ProgressBar in WPF? I don't
is there any way to create a button which will on click take you
Is there a way to create an html link using h:outputLink, other JSF tag
Is there way to create a border that is only on the top, left,
Is there easy way to create FILE* from WinApi HANDLE which points to one
is there any way to create hard links in windows xp ? i came
Is there a way to create a crash dump file automatically on application crash
Is there a way to create a callback function that fires when a list

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.