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. Keep a window "Always on Top"

Keep a window "Always on Top"

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 2 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
    Astricks
    wrote on last edited by
    #1

    How do I keep an application always on top? just like Winamp does.

    *

    D 1 Reply Last reply
    0
    • A Astricks

      How do I keep an application always on top? just like Winamp does.

      *

      D Offline
      D Offline
      Dominik Reichl
      wrote on last edited by
      #2

      Call SetWindowPos[^] onto your window, with the hWndInsertAfter parameter set to HWND_TOPMOST.


      Too many passwords to remember? Try KeePass Password Safe!

      A 1 Reply Last reply
      0
      • D Dominik Reichl

        Call SetWindowPos[^] onto your window, with the hWndInsertAfter parameter set to HWND_TOPMOST.


        Too many passwords to remember? Try KeePass Password Safe!

        A Offline
        A Offline
        Astricks
        wrote on last edited by
        #3

        It brings the window to the top, but it's not permanent. It goes back when you click on another window. It should be on top all the time. May be like "System modal".

        *

        D 1 Reply Last reply
        0
        • A Astricks

          It brings the window to the top, but it's not permanent. It goes back when you click on another window. It should be on top all the time. May be like "System modal".

          *

          D Offline
          D Offline
          Dominik Reichl
          wrote on last edited by
          #4

          If you would have read the MSDN page I linked to, you'd have noticed this: HWND_TOP - Places the window at the top of the Z order. HWND_TOPMOST - Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated. :rose:


          Too many passwords to remember? Try KeePass Password Safe!

          A 1 Reply Last reply
          0
          • D Dominik Reichl

            If you would have read the MSDN page I linked to, you'd have noticed this: HWND_TOP - Places the window at the top of the Z order. HWND_TOPMOST - Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated. :rose:


            Too many passwords to remember? Try KeePass Password Safe!

            A Offline
            A Offline
            Astricks
            wrote on last edited by
            #5

            It works! thanks :)

            *

            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