HOWTO: Controlling the Currently Running Instance of IE3 via DDE

Last reviewed: January 20, 1998
Article ID: Q160976
The information in this article applies to:
  • Microsoft ActiveX SDK, version 1.0
  • Microsoft Internet Explorer, version 3.0, 3.01, 3.02

SUMMARY

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.

MORE INFORMATION

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.

For more information about DDE support in Internet Explorer, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q160957
   TITLE     : Dynamic Data Exchange Support in Microsoft Internet Explorer

If 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

For Internet Explorer 3.x, more information on the InternetExplorer automation object can be found under the "Web Browsing Obj" section on the ActiveX SDK page at http://www.microsoft.com/intdev/sdk, or by searching on "InternetExplorer" off of the ActiveX SDK online documentation.

For Internet Explorer 4.0, refer to the "Reusing the WebBrowser Control" section under the "Internet Tools and Technologies" book of the Internet Client SDK documentation, or by searching on "InternetExplorer" off of the Internet Client SDK docs index.

Keywords          : AXSDKIEAutomation GetActiveObject
Technology        : kbole
Version           : 1.0
Platform          : WINDOWS
Issue type        : kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 20, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.