CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2005
    Posts
    1,828

    Enumerating Child Windows

    I have the handle to a 3rd party DialogWindow (lets say 0x10056) now I want to enumerate the handes number of child windows present in that. How can I accompalish this?

    Thanks in Advance

  2. #2
    Join Date
    Jul 2002
    Posts
    2,543

    Re: Enumerating Child Windows

    Not surprisingly, the function is called EnumChildWindows.
    http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx

  3. #3
    Join Date
    Apr 2005
    Posts
    1,828

    Re: Enumerating Child Windows

    Quote Originally Posted by Alex F View Post
    Not surprisingly, the function is called EnumChildWindows.
    http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx
    Thanks. Now that I have the list of child windows. I have 2 questions
    1) Using WM_GETTEXT can I extract the text from those windows? Whether the child window is a label, editbox, radiobutton, checkbox etc?

    2) Is there a way I can even get the positions of those windows? For example within a Window I have marked an area using CRect. I have to extract the child windows that lie only within that rectangle area. So how can it be accompalished?

    Thanks in Advance

  4. #4
    Join Date
    Jul 2002
    Posts
    2,543

    Re: Enumerating Child Windows

    1. GetWindowText
    http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx
    With one exception: This function cannot retrieve the text of an edit control in another application.
    2. GetWindowRect
    http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Enumerating Child Windows

    Quote Originally Posted by maverick786us View Post
    1) Using WM_GETTEXT can I extract the text from those windows? Whether the child window is a label, editbox, radiobutton, checkbox etc?
    I gave you a link to MSJ Q&A article in your another thread. Did you read it?


    Quote Originally Posted by maverick786us View Post
    2) Is there a way I can even get the positions of those windows? For example within a Window I have marked an area using CRect. I have to extract the child windows that lie only within that rectangle area. So how can it be accompalished?
    Doesn't GetWindowRect API work?
    There is also MFC CRect class with a lot of useful methods such as PtInRect and others...
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured