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. code to walk down all a program's windows

code to walk down all a program's windows

Scheduled Pinned Locked Moved C / C++ / MFC
ai-testingdata-structurestestingbeta-testingtutorial
5 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.
  • L Offline
    L Offline
    Lowell Boggs
    wrote on last edited by
    #1

    Does anyone know of an application or source code that can be used to walk down all the tree of all windows in a program? I'd like to write some test code that runs at my program's exit that visits all the windows in the program and prints information about those windows -- for example: 1. print the resource id of the window 2. print the window text (or small part there of) 3. if the window is a dialog, frame, etc, visit the sub-windows thereof and repeat the above I'm interested in doing some automated testing understand that the task of filtering windows from the list may be really high. Thanks, Lowell

    L H L 3 Replies Last reply
    0
    • L Lowell Boggs

      Does anyone know of an application or source code that can be used to walk down all the tree of all windows in a program? I'd like to write some test code that runs at my program's exit that visits all the windows in the program and prints information about those windows -- for example: 1. print the resource id of the window 2. print the window text (or small part there of) 3. if the window is a dialog, frame, etc, visit the sub-windows thereof and repeat the above I'm interested in doing some automated testing understand that the task of filtering windows from the list may be really high. Thanks, Lowell

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      There are win32 and MFC api's to get the top level window and to get a windows children. Combine those with some recursion and you'll be well on your way

      1 Reply Last reply
      0
      • L Lowell Boggs

        Does anyone know of an application or source code that can be used to walk down all the tree of all windows in a program? I'd like to write some test code that runs at my program's exit that visits all the windows in the program and prints information about those windows -- for example: 1. print the resource id of the window 2. print the window text (or small part there of) 3. if the window is a dialog, frame, etc, visit the sub-windows thereof and repeat the above I'm interested in doing some automated testing understand that the task of filtering windows from the list may be really high. Thanks, Lowell

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        You can use of EnumWindows for all top-level windows when you have handle to window you can use of other APIs.

        1 Reply Last reply
        0
        • L Lowell Boggs

          Does anyone know of an application or source code that can be used to walk down all the tree of all windows in a program? I'd like to write some test code that runs at my program's exit that visits all the windows in the program and prints information about those windows -- for example: 1. print the resource id of the window 2. print the window text (or small part there of) 3. if the window is a dialog, frame, etc, visit the sub-windows thereof and repeat the above I'm interested in doing some automated testing understand that the task of filtering windows from the list may be really high. Thanks, Lowell

          L Offline
          L Offline
          Lowell Boggs
          wrote on last edited by
          #4

          Thanks for the hints! I was hoping to find some utility program to help me, but I guess I'll just have to roll up my sleeves and get to work. thanks! Lowell

          P 1 Reply Last reply
          0
          • L Lowell Boggs

            Thanks for the hints! I was hoping to find some utility program to help me, but I guess I'll just have to roll up my sleeves and get to work. thanks! Lowell

            P Offline
            P Offline
            Peter Weyzen
            wrote on last edited by
            #5

            I like Winspector[^]

            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [SoonR Inc -- PC Power delivered to your phone](http://www.soonr.com)

            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