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. Why is the window always topmost?

Why is the window always topmost?

Scheduled Pinned Locked Moved C / C++ / MFC
comhelpquestion
4 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.
  • F Offline
    F Offline
    Fredrik Skog
    wrote on last edited by
    #1

    I have a modeless dialog that is created and popped by an SDI application. The problem is that the dialog is always topmost. I would like the SDI app to be topmost when I click in its window, placing the popup behind it. Should a modeless dialog behave like this? Cheers,
    /Fredrik

    Sonork ID: 100.11430:PhatBoy

    J C 2 Replies Last reply
    0
    • F Fredrik Skog

      I have a modeless dialog that is created and popped by an SDI application. The problem is that the dialog is always topmost. I would like the SDI app to be topmost when I click in its window, placing the popup behind it. Should a modeless dialog behave like this? Cheers,
      /Fredrik

      Sonork ID: 100.11430:PhatBoy

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      Try setting CWnd::GetDesktopWindow() as the parent of your modeless dialog, instead of your main window. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      1 Reply Last reply
      0
      • F Fredrik Skog

        I have a modeless dialog that is created and popped by an SDI application. The problem is that the dialog is always topmost. I would like the SDI app to be topmost when I click in its window, placing the popup behind it. Should a modeless dialog behave like this? Cheers,
        /Fredrik

        Sonork ID: 100.11430:PhatBoy

        C Offline
        C Offline
        Carlos Antollini
        wrote on last edited by
        #3

        What do you want? That the mainframe will be topmost, or the dialog? Best Regards... There is an old saying that if a million monkeys typed on a million keyboards for a million years, eventually all the works of Shakespeare would be produced. Now, thanks to Usenet, we know this is not true. Carlos Antollini. Sonork ID 100.10529 cantollini

        F 1 Reply Last reply
        0
        • C Carlos Antollini

          What do you want? That the mainframe will be topmost, or the dialog? Best Regards... There is an old saying that if a million monkeys typed on a million keyboards for a million years, eventually all the works of Shakespeare would be produced. Now, thanks to Usenet, we know this is not true. Carlos Antollini. Sonork ID 100.10529 cantollini

          F Offline
          F Offline
          Fredrik Skog
          wrote on last edited by
          #4

          I want the window I click in to be topmost. Using CWnd::GetDesktopWindow(), as Joaquín wrote in his post, works fine. Passing the this pointer to CDialog::Create() makes the dialog be always topmost. Cheers,
          /Fredrik

          Sonork ID: 100.11430:PhatBoy

          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