to chinesun(石上):
兄弟,我是在网页中嵌入Tidestone公司的formula one book 6.1控件的啊。
通过JavaScript响应它的事件,同样的代码,在用window.open和window.showModelessDialog方法弹出的页面中,事件竟然不触发,而用window.showModalDialog方法却是可以的。
IActiveScriptSiteWindow(你的带ActiveX控件的窗口):This interface is implemented by hosts that support a user interface on the same object as IActiveScriptSite. Hosts that do not support a user interface, such as servers, would not implement the IActiveScriptSiteWindow interface. The scripting engine accesses this interface by calling QueryInterface from IActiveScriptSite.
其方法主要有:
1、GetWindow:(Retrieves the window handle that can act as the owner of a pop-up window that the scripting engine must display. )
2、EnableModeless:(Causes the host to enable or disable its main window as well as any modeless dialog boxes.)
EnableModeless:
HRESULT IActiveScriptSite::EnableModeless(
BOOL fEnable // enable flag
);
Causes the host to enable or disable its main window as well as any modeless dialog boxes.
Returns S_OK if successful, or E_FAIL if an error occurred.
fEnable
[in] Flag that, if TRUE, enables the main window and modeless dialogs or, if FALSE, disables them.
This method is identical to the IOleInPlaceFrame::EnableModeless method.