Iterating through web browser's controls
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Iterating through web browser's controls

  1. #1
    Join Date
    Jan 2005
    Location
    Clemson, South Carolina
    Posts
    651

    Iterating through web browser's controls

    Hello all,

    I'm curious if there is a way to iterate through the controls on a webpage. For instance, I tried EnumChildWindows using the parent window of the browser, but I haven't had any luck - it returns nothing. Does anyone have any suggestions where I can start researching how to find the child controls?

    I'm using Visual Studio 2010, programming in C++.

    Thanks!
    error C2146a : syntax error : nebulizer stained in the tower floppy apple rider. Go rubble in flee smite. Bleeble snip snip.

    Documentation says: error C2146a - This means there is an error somewhere in the course of human endeavor. Fix in the usual way.

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,009

    Re: Iterating through web browser's controls

    Well, begin with the Spy++. Can it find any child window in your browser? If it it can but your code cannot then your code is not correct. Try do debug it to find the reason of incorrection.
    Victor Nijegorodov

  3. #3
    Join Date
    Jan 2005
    Location
    Clemson, South Carolina
    Posts
    651

    Re: Iterating through web browser's controls

    Spy++ didn't show any child windows in the browser, which is probably why my code didn't work. Is there any other way to manipulate the controls in a browser, such as text inputs, buttons and so forth?
    error C2146a : syntax error : nebulizer stained in the tower floppy apple rider. Go rubble in flee smite. Bleeble snip snip.

    Documentation says: error C2146a - This means there is an error somewhere in the course of human endeavor. Fix in the usual way.

  4. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    5,877

    Re: Iterating through web browser's controls

    Best regards,
    Igor

  5. #5
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    7,994

    Re: Iterating through web browser's controls

    Spy++ didn't show any child windows in a web page, simply because a web page doesn't contain any child window, but HTML elements.
    As Igor already suggested, for IE use COM interface to enumerate them.
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    10,958

    Re: Iterating through web browser's controls

    To grab the elements within a browser (even in a separate browser instance), use Active Accessibility or UIAutomation.

  7. #7
    Join Date
    Jan 2005
    Location
    Clemson, South Carolina
    Posts
    651

    Re: Iterating through web browser's controls

    Ok. Thanks guys. I'll have to look into those possibilities.
    error C2146a : syntax error : nebulizer stained in the tower floppy apple rider. Go rubble in flee smite. Bleeble snip snip.

    Documentation says: error C2146a - This means there is an error somewhere in the course of human endeavor. Fix in the usual way.

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center