Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Window TopMost window on top???

Window TopMost window on top???

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestionlearning
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Arrin
    wrote on last edited by
    #1

    Hello community, how to create a second window that is always on top of a main window, so if i click on the main window that this pop up window stay on top until my function is finished??!? I create a simple dialog with the resource editor and set "Set Foreground" to true, but even if i click on the main dialog this new little dialog is in the background, how to avoid this? If i set "Topmost" to true, than is my pop up dialog always on top, but for all other windows too, and i like that hi is only for my main dialog in the foreground!? Thanks for help Arrin EDIT: after i show my child dialog and bring him to top i disable my main dialog to make him unklickable and when my funktion is finished i enable him again, but im not sure that this is the right way!?

    // in my funktion:
    dlgProgress.ShowWindow(SW_SHOW);
    dlgProgress.SetForegroundWindow();
    EnableWindow(FALSE); // for main dialog
    // after funktion:
    EnableWindow(TRUE); // for main dialog

    _ J 2 Replies Last reply
    0
    • A Arrin

      Hello community, how to create a second window that is always on top of a main window, so if i click on the main window that this pop up window stay on top until my function is finished??!? I create a simple dialog with the resource editor and set "Set Foreground" to true, but even if i click on the main dialog this new little dialog is in the background, how to avoid this? If i set "Topmost" to true, than is my pop up dialog always on top, but for all other windows too, and i like that hi is only for my main dialog in the foreground!? Thanks for help Arrin EDIT: after i show my child dialog and bring him to top i disable my main dialog to make him unklickable and when my funktion is finished i enable him again, but im not sure that this is the right way!?

      // in my funktion:
      dlgProgress.ShowWindow(SW_SHOW);
      dlgProgress.SetForegroundWindow();
      EnableWindow(FALSE); // for main dialog
      // after funktion:
      EnableWindow(TRUE); // for main dialog

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      Looks like you need a modal dialog. If you're using MFC, call CDialog::DoModal[^]. Otherwise call DialogBox[^].

      «_Superman_» I love work. It gives me something to do between weekends.

      1 Reply Last reply
      0
      • A Arrin

        Hello community, how to create a second window that is always on top of a main window, so if i click on the main window that this pop up window stay on top until my function is finished??!? I create a simple dialog with the resource editor and set "Set Foreground" to true, but even if i click on the main dialog this new little dialog is in the background, how to avoid this? If i set "Topmost" to true, than is my pop up dialog always on top, but for all other windows too, and i like that hi is only for my main dialog in the foreground!? Thanks for help Arrin EDIT: after i show my child dialog and bring him to top i disable my main dialog to make him unklickable and when my funktion is finished i enable him again, but im not sure that this is the right way!?

        // in my funktion:
        dlgProgress.ShowWindow(SW_SHOW);
        dlgProgress.SetForegroundWindow();
        EnableWindow(FALSE); // for main dialog
        // after funktion:
        EnableWindow(TRUE); // for main dialog

        J Offline
        J Offline
        john john mackey
        wrote on last edited by
        #3

        I may have had a similar problem back several months ago. I have a modeless PropertySheet (a modeless tabbed dialog window) separate from my main Doc-View window. I created my modeless PropertySheet window: // Modeless property sheet - with parent window as such and call to SetWindowPos() allows for property sheet to be on top m_pSettings->Create(this, WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | DS_MODALFRAME | DS_CONTEXTHELP, WS_EX_DLGMODALFRAME); m_pSettings->SetWindowPos(this,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE); I do recall that there was something special to this (modeless property sheet) and the peeps here helped me out!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups