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. How to get all controls of current dialog?

How to get all controls of current dialog?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
6 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.
  • M Offline
    M Offline
    mehmetned
    wrote on last edited by
    #1

    There is a dialog and it has more than one controls.I want to get all these controls to set or change some their properties at runtime. To do this , i use that code. CWnd* pChildWnd = wnd->GetWindow(GW_CHILD); while ( pChildWnd ) { // other code here pChildWnd = pChildWnd->GetWindow(GW_HWNDNEXT); } But i can't get controls and this while loop enters infinite loop. Please help me to get all controls. Thanks.

    D H 2 Replies Last reply
    0
    • M mehmetned

      There is a dialog and it has more than one controls.I want to get all these controls to set or change some their properties at runtime. To do this , i use that code. CWnd* pChildWnd = wnd->GetWindow(GW_CHILD); while ( pChildWnd ) { // other code here pChildWnd = pChildWnd->GetWindow(GW_HWNDNEXT); } But i can't get controls and this while loop enters infinite loop. Please help me to get all controls. Thanks.

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

      mehmetned wrote:

      There is a dialog and it has more than one controls.I want to get all these controls...

      Can't you use EnumChildWindows()?

      "Love people and use things, not love things and use people." - Unknown

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      1 Reply Last reply
      0
      • M mehmetned

        There is a dialog and it has more than one controls.I want to get all these controls to set or change some their properties at runtime. To do this , i use that code. CWnd* pChildWnd = wnd->GetWindow(GW_CHILD); while ( pChildWnd ) { // other code here pChildWnd = pChildWnd->GetWindow(GW_HWNDNEXT); } But i can't get controls and this while loop enters infinite loop. Please help me to get all controls. Thanks.

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

        See How to set a font for all child windows[^] of course its for change font but it is helpful for you.

        M 1 Reply Last reply
        0
        • H Hamid Taebi

          See How to set a font for all child windows[^] of course its for change font but it is helpful for you.

          M Offline
          M Offline
          mehmetned
          wrote on last edited by
          #4

          It was very useful for my problem. thanks

          H 1 Reply Last reply
          0
          • M mehmetned

            It was very useful for my problem. thanks

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

            Its good news for me it was helpful for you. ;)

            T 1 Reply Last reply
            0
            • H Hamid Taebi

              Its good news for me it was helpful for you. ;)

              T Offline
              T Offline
              ThatsAlok
              wrote on last edited by
              #6

              Hamid. wrote:

              Its good news for me it was helpful for you.

              Hows life going dude... evrything ok at your END

              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
              Never mind - my own stupidity is the source of every "problem" - Mixture

              cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

              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