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 retrieve the Child window handle ?????

How to retrieve the Child window handle ?????

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.
  • G Offline
    G Offline
    GauranG Shah
    wrote on last edited by
    #1

    I want to retrive the Handle of the child window. But facing a problem.Threre are two child window with same name and when I use the Function FindWindowEx() I got the Handle of the First child. And don't know how to get the handle of second child. It is hierarchy in Spy++ is as below. And I want to retrive the Handle of TExRichEdit The code I am using Is like this. HWND hChat= FindWindow(_T("TfrmChat"),0); hChat = FindWindowEx(hChat,0,_T("TPanel"),0);

    - Window 000E03A2 ""TfrmChat
    |

    • Window 000903D8 ""Tpanel

    | |
    | -Window 001903D4 ""Tpanel
    |

    • Window 000803C4 ""Tpanel
      |
      -Window 001903D4 ""TExRichEdit
    R N S 3 Replies Last reply
    0
    • G GauranG Shah

      I want to retrive the Handle of the child window. But facing a problem.Threre are two child window with same name and when I use the Function FindWindowEx() I got the Handle of the First child. And don't know how to get the handle of second child. It is hierarchy in Spy++ is as below. And I want to retrive the Handle of TExRichEdit The code I am using Is like this. HWND hChat= FindWindow(_T("TfrmChat"),0); hChat = FindWindowEx(hChat,0,_T("TPanel"),0);

      - Window 000E03A2 ""TfrmChat
      |

      • Window 000903D8 ""Tpanel

      | |
      | -Window 001903D4 ""Tpanel
      |

      • Window 000803C4 ""Tpanel
        |
        -Window 001903D4 ""TExRichEdit
      R Offline
      R Offline
      Roger Broomfield
      wrote on last edited by
      #2

      HWND hChat= FindWindow(_T("TfrmChat"),0); HWND hPanel = FindWindow(_T("TPanel"),0); hPanel = FindWindowEx(hChat,hPanel,_T("TPanel"),0); Of course you might want to check that the first TPanel doesnt actually have the TExRichEdit as its child before looking for the second panel.

      G 1 Reply Last reply
      0
      • G GauranG Shah

        I want to retrive the Handle of the child window. But facing a problem.Threre are two child window with same name and when I use the Function FindWindowEx() I got the Handle of the First child. And don't know how to get the handle of second child. It is hierarchy in Spy++ is as below. And I want to retrive the Handle of TExRichEdit The code I am using Is like this. HWND hChat= FindWindow(_T("TfrmChat"),0); hChat = FindWindowEx(hChat,0,_T("TPanel"),0);

        - Window 000E03A2 ""TfrmChat
        |

        • Window 000903D8 ""Tpanel

        | |
        | -Window 001903D4 ""Tpanel
        |

        • Window 000803C4 ""Tpanel
          |
          -Window 001903D4 ""TExRichEdit
        N Offline
        N Offline
        nbugalia
        wrote on last edited by
        #3

        This should work HWND hParent = FindWindow(_T("TfrmChat"),0); HWND hChild = FindWindowEx(hParent,0,_T("TPanel"),0); hParent = FindWindowEx(hParent,hChild,_T("TPanel"),0); hChild = FindWindowEx(hParent,0,_T("TExRichEdit"),0);

        G 1 Reply Last reply
        0
        • G GauranG Shah

          I want to retrive the Handle of the child window. But facing a problem.Threre are two child window with same name and when I use the Function FindWindowEx() I got the Handle of the First child. And don't know how to get the handle of second child. It is hierarchy in Spy++ is as below. And I want to retrive the Handle of TExRichEdit The code I am using Is like this. HWND hChat= FindWindow(_T("TfrmChat"),0); hChat = FindWindowEx(hChat,0,_T("TPanel"),0);

          - Window 000E03A2 ""TfrmChat
          |

          • Window 000903D8 ""Tpanel

          | |
          | -Window 001903D4 ""Tpanel
          |

          • Window 000803C4 ""Tpanel
            |
            -Window 001903D4 ""TExRichEdit
          S Offline
          S Offline
          Sreedhar DV
          wrote on last edited by
          #4

          try FindWindowEx static CWnd* FindWindowEx( HWND hwndParent, HWND hwndChildAfter, LPCTSTR lpszClass, LPCTSTR lpszWindow );

          Sreedhar DV [Real success is having courage to meet failure without being defeated.]

          1 Reply Last reply
          0
          • N nbugalia

            This should work HWND hParent = FindWindow(_T("TfrmChat"),0); HWND hChild = FindWindowEx(hParent,0,_T("TPanel"),0); hParent = FindWindowEx(hParent,hChild,_T("TPanel"),0); hChild = FindWindowEx(hParent,0,_T("TExRichEdit"),0);

            G Offline
            G Offline
            GauranG Shah
            wrote on last edited by
            #5

            Thnx a lot.

            1 Reply Last reply
            0
            • R Roger Broomfield

              HWND hChat= FindWindow(_T("TfrmChat"),0); HWND hPanel = FindWindow(_T("TPanel"),0); hPanel = FindWindowEx(hChat,hPanel,_T("TPanel"),0); Of course you might want to check that the first TPanel doesnt actually have the TExRichEdit as its child before looking for the second panel.

              G Offline
              G Offline
              GauranG Shah
              wrote on last edited by
              #6

              Thnx a lot

              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