Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Feb 2003
    Location
    Grapevine, Texas, USA
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Extracting IE URL's with Visual C++ 6

    I hope this is the correct spot for this post.

    I'm currently working on a small application using Visual Studio 6/C++. I need to find a way to find all currently-active IE windows and get the URL from each.

    I'm fairly certain I can do the first part using GetWindow retrievals for the various handles and titles, but I'm not sure how to extract the URL's. If anyone can help, I'd much appreciate it.

    TIA

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Extracting IE URL's with Visual C++ 6

    Using the WebBrowser object you can GetObject one of the windows, but I don't know how you can get the others that way. Always seemed like a dead end. I would love to have an answer. If no one responds here, I'll move this to the VB/VBA board and see if there's any inspiration there.

  3. #3
    New Lounger
    Join Date
    Feb 2003
    Location
    Grapevine, Texas, USA
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Extracting IE URL's with Visual C++ 6

    FYI, I finally found a way through a lot of trial and error with C++. The main issue is that I need to get the address of browser windows *not* instanced using the web browser object.

    For those that are interested, the basic method is this:
    1) start with the root of the process tree via GetDesktop Window()
    2) using a loop, use GetWindow () to get each child of the desktop, then use GetClassName() for the window you find .. do a strcmp() to find if it's a IE browser object (all IE browser objects have a class name of IEFrame)
    3)if so, you can step down *that* thread via GetWindowEx(); to the edit control for the address window and use SendMessage with 2nd parameter = WM_GETTEXT to retrieve the text from that window.

    *goes back to beating my head against MFC's*

Posting Permissions

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