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. Get Window Zorder?

Get Window Zorder?

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

    Hi, all :) How can I get a window’s current view placement order (also called “Zorder”)? And is it possible to enumerate from the absolute top window to the last? So that the first window you get has the highest Zorder. Aidman » over and out

    J D N 3 Replies Last reply
    0
    • A Aidman

      Hi, all :) How can I get a window’s current view placement order (also called “Zorder”)? And is it possible to enumerate from the absolute top window to the last? So that the first window you get has the highest Zorder. Aidman » over and out

      J Offline
      J Offline
      Joseph Dempsey
      wrote on last edited by
      #2

      I think that is going to depend on exactly WHERE you want to enumerate from and what type on windows you are trying to enumerate. Being that i'm not sure what you mean here is my best guess. I would use ::GetWindow( ::GetDesktopWindow(), GW_HWNDFIRST ); after that it looks like you can just sit in a loop. This is not recommended though according to the docs. I'm not sure of the exact zorder impact ( ordering ) but the other thing to try would be to give EnumChildWindows a shot. Well good luck. Joseph Dempsey joseph_r_dempsey@yahoo.com "Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning." --anonymous

      A 1 Reply Last reply
      0
      • J Joseph Dempsey

        I think that is going to depend on exactly WHERE you want to enumerate from and what type on windows you are trying to enumerate. Being that i'm not sure what you mean here is my best guess. I would use ::GetWindow( ::GetDesktopWindow(), GW_HWNDFIRST ); after that it looks like you can just sit in a loop. This is not recommended though according to the docs. I'm not sure of the exact zorder impact ( ordering ) but the other thing to try would be to give EnumChildWindows a shot. Well good luck. Joseph Dempsey joseph_r_dempsey@yahoo.com "Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning." --anonymous

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

        OK Thanks, why isn't it recommended? :( Aidman » over and out

        J 1 Reply Last reply
        0
        • A Aidman

          OK Thanks, why isn't it recommended? :( Aidman » over and out

          J Offline
          J Offline
          Joseph Dempsey
          wrote on last edited by
          #4

          According to the documentation calling GetWindow in a loop is unsafe because it could get you into a infinite loop. This probably has to do with the zorder changing on windows that you are enumerating. EnumChildWindows takes this into account and protects against it happening. Joseph Dempsey joseph_r_dempsey@yahoo.com "Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning." --anonymous

          1 Reply Last reply
          0
          • A Aidman

            Hi, all :) How can I get a window’s current view placement order (also called “Zorder”)? And is it possible to enumerate from the absolute top window to the last? So that the first window you get has the highest Zorder. Aidman » over and out

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            See if GetTopWindow() will get you started.

            1 Reply Last reply
            0
            • A Aidman

              Hi, all :) How can I get a window’s current view placement order (also called “Zorder”)? And is it possible to enumerate from the absolute top window to the last? So that the first window you get has the highest Zorder. Aidman » over and out

              N Offline
              N Offline
              Neville Franks
              wrote on last edited by
              #6

              "Utility to display information on all windows in z-order and their children." http://www.codeproject.com/useritems/WINDUMP.asp[^] may be helpfull. Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com

              A 1 Reply Last reply
              0
              • N Neville Franks

                "Utility to display information on all windows in z-order and their children." http://www.codeproject.com/useritems/WINDUMP.asp[^] may be helpfull. Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com

                A Offline
                A Offline
                Aidman
                wrote on last edited by
                #7

                Great Program! I love it, exactly what I was looking for. Thanks Neville :) Aidman » over and 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