|
-
Jul 5th, 2001, 11:01 AM
#1
Thread Starter
New Member
Help with Controlling Internet Explorer
Hi Everyone,
I'm writing this application right now where I need to start a new Internet Explorer process (meaning that I can't use the IE control since it will use an existing IE process if there is already one running) and then pass it two web site addresses one right after the other. Basically I'm using SendMessage to pass the URL strings to the Address Edit box like so:
'Sending first URL to edit box, and then sending the enter
'key to execute the URL change
Call SendMessage(hEdit,WM_SETTEXT, 0&, ByVal sURL1)
Call SendMessage(hEdit, WM_KEYDOWN, vbKeyReturn, 0)
Sleep 1200 'Sleep so 1st page has some time to execute
'Sending second URL to edit box
Call SendMessage(hEdit,WM_SETTEXT, 0&, ByVal sURL2)
Call SendMessage(hEdit, WM_KEYDOWN, vbKeyReturn, 0)
I have one of two problems with this method. The first issue I think won't be much of a problem, but it might be sometime down the line. Basically, if I have the first IE window handle (the handle to IEFrame), then it is easy to find the handle to the Edit window for the address. But, what if an end user has other toolbars on their Internet Explorer, such as the Yahoo toolbar or Google toolbar (which I use). Then there are multiple Edit boxes. Fortunately with the Google toolbar, the edit box handle is one level deeper in the window tree, but what if there are other toolbars which have the exact same window tree as the address edit box? I'm not sure if there are any that exist, but that might come into play at some point.
My other issue that I'm more worried about is what if the end user turns off their address toolbar for IE? Then there is no edit box for me to pass messages to.
Basically my question then is: Does anyone know a different way of passing a URL to IE without passing the message to the address bar? If there is a way to do this, would this method be consistent across different versions of IE? One method I've thought of is to just pass in Ctrl-O which opens up the open box, and then I can just pass in commands there, but I don't know if I want to show the users that I have to use an unconventional method to open up a web page.
Thanks for any suggestions anyone might have!
-
Jul 5th, 2001, 11:56 AM
#2
Thread Starter
New Member
I think I answered my own question...
Well I did an experiement...I turned off both my Google toolbar and the address toolbar and then I used Spy++ to check for windows, and the address window is still registed as one of IEFrame's child windows (well great, great....great grandchild windows anyhow). The weird thing is, is that the Google toolbar no longer exists as a child window.
Anyhow, the good news is that I can still use SendMessage to the address edit box and change the URL for IE, and it works great!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|