HOWTO: Controlling the Currently Running Instance of IE3 via DDEID: Q160976
|
In some instances you may want to control Internet Explorer from another
application, typically to navigate to a specific URL. One way you can do
this is through the InternetExplorer OLE Automation object that Internet
Explorer exposes. However, this method always launches a new instance of
Internet Explorer, which may not necessarily be the desired behavior.
OLE Automation allows an application to connect to an instance of some
object type that is already running through the Running Object Table (ROT).
However, InternetExplorer, version 3.01 and earlier, does not register
itself in the ROT, and therefore, cannot be controlled in this manner. The
only way to currently do this with Internet Explorer is through DDE.
Using the Win32 SDK's DDEML\CLIENT sample, one can easily verify that DDE
with Internet Explorer is fairly straightforward, as long as the correct
information is specified. To tell Internet Explorer to navigate to a
specific URL, for instance, you specify the following information in your
DDE transaction:
Application Name = iexplore
Topic Name = WWW_OpenURL
Item Name = http://www.microsoft.com
Transaction Type = EXECUTE or REQUEST (either one works!)
Similarly, to get the current URL of a running instance of Internet
Explorer, for example, you specify the following information:
Application Name = iexplore
Topic Name = WWW_GetWindowInfo
Item Name = DoGetWindowInfo
Transaction Type = REQUEST
Note that IE 2.0 and earlier used "mosaic" as its application name, instead
of "iexplore" as specified above.
Q160957 Dynamic Data Exchange Support in Microsoft Internet ExplorerIf launching a new Internet Explorer window is desired, one workaround would be to use the InternetExplorer automation object, as mentioned in the SUMMARY section above. For example, you can launch Internet Explorer using Visual Basic and have it open the Microsoft Web page at http://www.microsoft.com by doing the following:
Dim Explorer As Object
Explorer = CreateObject ("InternetExplorer.Application")
Explorer.Navigate "http://www.microsoft.com"
Explorer.Visible = True
Additional query words:
Keywords : kbIE300 kbIE301 kbIE302 AXSDKIEAutomation GetActiveObject
Version :
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: May 3, 1999