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 a child window?

Get a child window?

Scheduled Pinned Locked Moved C / C++ / MFC
question
8 Posts 6 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.
  • S Offline
    S Offline
    see me
    wrote on last edited by
    #1

    How can i understand the child window which i got is of child dialog? i did this to get the child. CWnd* pWnd = GetWindow( GW_CHILD ); i want to know if pWnd is of child dialog? ajeesh c v

    R H N T 4 Replies Last reply
    0
    • S see me

      How can i understand the child window which i got is of child dialog? i did this to get the child. CWnd* pWnd = GetWindow( GW_CHILD ); i want to know if pWnd is of child dialog? ajeesh c v

      R Offline
      R Offline
      Russell
      wrote on last edited by
      #2

      I'm not sure that I understand your question, but I think that if you want to know what kind of object is pointing pWnd you could use if(! pWnd ->IsKindOf(RUNTIME_CLASS(CChildClassName))){;) //Error }else{ ... }

      1 Reply Last reply
      0
      • S see me

        How can i understand the child window which i got is of child dialog? i did this to get the child. CWnd* pWnd = GetWindow( GW_CHILD ); i want to know if pWnd is of child dialog? ajeesh c v

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

        Hope I understood your question see IsChild[^] and CWnd::IsChild

        S 1 Reply Last reply
        0
        • S see me

          How can i understand the child window which i got is of child dialog? i did this to get the child. CWnd* pWnd = GetWindow( GW_CHILD ); i want to know if pWnd is of child dialog? ajeesh c v

          N Offline
          N Offline
          Nibu babu thomas
          wrote on last edited by
          #4

          Ajeesh c v wrote:

          i want to know if pWnd is of child dialog?

          Do you wish to check pWnd is a Child dialog or pWnd is a child of a dialog. Use GetParent to find out the parent and then use GetClassName to find out the class. You can also refer GetParentOwner.


          Nibu thomas Software Developer Faqs by Michael dunn

          N 1 Reply Last reply
          0
          • N Nibu babu thomas

            Ajeesh c v wrote:

            i want to know if pWnd is of child dialog?

            Do you wish to check pWnd is a Child dialog or pWnd is a child of a dialog. Use GetParent to find out the parent and then use GetClassName to find out the class. You can also refer GetParentOwner.


            Nibu thomas Software Developer Faqs by Michael dunn

            N Offline
            N Offline
            Nishad S
            wrote on last edited by
            #5

            What he need is to check whether a window ( got from hWnd ) is a dialog window or a child control ( means edit, static, etc. ) - NS -

            1 Reply Last reply
            0
            • H Hamid Taebi

              Hope I understood your question see IsChild[^] and CWnd::IsChild

              S Offline
              S Offline
              see me
              wrote on last edited by
              #6

              i got the child window using CWnd* pWnd = GetWindow( GW_CHILD ); but the pWnd i got is of the edit control of the parent dialog. i need to get only the pWnd of child dialog and not of child controls. ajeesh

              R 1 Reply Last reply
              0
              • S see me

                i got the child window using CWnd* pWnd = GetWindow( GW_CHILD ); but the pWnd i got is of the edit control of the parent dialog. i need to get only the pWnd of child dialog and not of child controls. ajeesh

                R Offline
                R Offline
                Russell
                wrote on last edited by
                #7

                Use pWnd=pWnd->GetNextWindow() in a while loop and exit when the pWnd points the right object.

                1 Reply Last reply
                0
                • S see me

                  How can i understand the child window which i got is of child dialog? i did this to get the child. CWnd* pWnd = GetWindow( GW_CHILD ); i want to know if pWnd is of child dialog? ajeesh c v

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

                  Ajeesh c v wrote:

                  CWnd* pWnd = GetWindow( GW_CHILD );i want to know if pWnd is of child dialog?

                  what about GetParent(..) api!

                  "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                  cheers, Alok Gupta VC Forum Q&A :- I/ IV

                  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