Activate ActiveX Control Release Date: 2006-3-29 |Updated on: 2006-3-29
Internet Development Index
You cannot directly interact with Microsoft ActiveX controls loaded with APPLET, EMBED, or OBJECT elements. You can interact with these controls only after activating the user interface of these controls. This article describes how Microsoft Internet Explorer handles ActiveX controls and shows how to load ActiveX controls to activate their interfaces. It also describes the impact of such behavior on auxiliary tools and applications hosting WebBrowser controls.
This topic contains the following parts.
Content on this page
|
Understand control activation |
|
Externally loaded interactive controls |
|
Programmatically determine whether the control is not activated |
|
Secondary Impact |
|
Influence of WebBrowser Control |
|
Appendix A: DHTML events blocked by inactive controls |
For more information about the platform affected by this update, see Internet Explorer ActiveX update.
Understand control activation
Interactive controlsIs an ActiveX control that provides a user interface. When the Web page is usedAPPLET,EMBEDOrOBJECTWhen an ActiveX control is loaded to an element, the user interface of the control is blocked until the user activates it. If a page uses these elements to load multiple controls, each interactive control must be activated independently.
If a widget is not activated, the following results are displayed.
• |
User interaction-relatedDynamicHTML (DHTML)Event(Such as onblur and onclick) are blocked. Appendix A lists DHTML events that are blocked when the control is not activated. |
• |
This control does not respond to window messages generated by the keyboard or mouse, such as WM_CLICK and WM_KEYPRESS. |
• |
Overwrite the window (the OLE site created for the Control) to prevent the keyboard and mouse messages from reaching the inactive control. |
After an inactive control is created, Internet Explorer uses different technologies to prevent messages in the keyboard or mouse window from reaching the control. If the inactive control is a window control (such as the HTML Help Control), Internet Explorer usesEnableWindowFunctionDisable the window of the inactive control. When a user activates a window control, the function activates the disabled window. If the inactive control is a windowless control (such as an Office Web component), the container of the control filters keyboard and mouse messages.
If a control is not activated, it does not respond to user input but performs operations unrelated to interaction. For example, if you open a Web page that uses a Microsoft Windows Media Player to play a music file, the page is loaded before playing music. You can interact with the Windows Media Player only after the user interface of the control is activated, as shown in.
NoteAlthough the inactive controls do not respond to any direct user interaction, they respond to script commands.
To activate an interactive control, you can click the control or use the Tab key to set the focus on the control, and then press the SPACEBAR or ENTER key. Interactive controls loaded from external scripts can immediately respond to user interaction without activation.
Some controls with Windows use Windows API functions (such as GetKeyState and GetCursorPos) to determine the keyboard and mouse states and then respond to the function results. For these controls only, a prompt is displayed before the control is run in Internet Explorer. To run the control, you must click the button in the message window before loading the page. After the widget is loaded, it does not need to be activated. Currently, the following controls have this behavior, but the supplier is continuing to develop new controls that do not have this behavior.
• |
Virtools™Web Player from Virtools SA |
• |
Macromedia Shockwave Player™From Adobe Systems Inc. |
• |
QuickTime™From Apple Computer, Inc. |
When loading from an external script file, these controls do not display a prompt.
The prompt dialog box is displayed.
Back to Top
Externally loaded interactive controls
To create a Web page that loads interactive controls (these controls immediately respond to user input), use Microsoft JScript to load controls from external script files. You cannot write script elements inline with the main HTML page to load controls from the outside. For exampleWritelnFunction), the loaded control is the same as that loaded by the HTML document itself, and needs to be activated. To ensure that the control is interactive after being loaded, use any of the following technologies.
The following example usesDocument. writeDynamically load controls.
// HTML File