把有JS的本地html文件嵌入到 窗口 结果不显示网页
本帖最后由 nbmpe 于 2020-12-14 17:47 编辑把有JS的本地html文件嵌入到窗口 结果不显示
另:如果 嵌入窗口成功,硬新HTML内的数值内容,后,怎么更新窗口显示的K线?
下面是,相关文件!
网页显示应为下图
你如果不能正常显示,那你先用你的Ie随便打开个网页看能打开不。如果不能,就在ie中初始化一下IE.修复一下
ran wo he chou chang
本帖最后由 nbmpe 于 2020-12-15 09:08 编辑
绿色风 发表于 2020-12-15 08:49
ran wo he chou chang
这两个文件同一文件夹下都有,只是我只上传了一个。你改下文件名。 绿色风 发表于 2020-12-15 08:49
ran wo he chou chang
你把文件名改正确,可以正常显示吗?我的是WIN7X64,直接打开HTML可以。打开软件不能显示。 nbmpe 发表于 2020-12-15 09:09
你把文件名改正确,可以正常显示吗?我的是WIN7X64,直接打开HTML可以。打开软件不能显示。
改正确,肯定能显示 呀 你需要的是进行IE版本控制,见链接:https://www.autoitx.com/forum.php?mod=viewthread&tid=71414
echarts在IE9以下就不兼容了
附正常运行代码(win10 x64)
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
_IEErrorHandlerRegister()
$MTV = _IECreateEmbedded()
Dim $text = "", $Dir = ""
Dim $message = "请选择视频文件"
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("au3加载wmplayer例子", @DesktopWidth - 100, @DesktopHeight - 100, -1, -1)
$GUIActive = GUICtrlCreateObj($MTV, 0, 0, 1600, 1280)
_AddMyIEVersion(1)
_IENavigate($MTV, @ScriptDir & "\K线1.html")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _AddMyIEVersion($tag = 1)
Local $script = @ScriptName
If Not @Compiled Then
If $tag = 1 Then
RegWrite('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3.exe', 'REG_DWORD', '9000')
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3.exe', 'REG_DWORD', '9000')
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3.exe', 'REG_DWORD', '9000')
RegWrite('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3_x64.exe', 'REG_DWORD', '9000')
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3_x64.exe', 'REG_DWORD', '9000')
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3_x64.exe', 'REG_DWORD', '9000')
Else
RegDelete('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3.exe')
RegDelete('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3.exe')
RegDelete('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3.exe')
RegDelete('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3_x64.exe')
RegDelete('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3_x64.exe')
RegDelete('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3_x64.exe')
EndIf
Else
If $tag = 1 Then
RegWrite('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', $script, 'REG_DWORD', '11000')
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', $script, 'REG_DWORD', '11000')
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', $script, 'REG_DWORD', '11000')
Else
RegDelete('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', $script)
RegDelete('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', $script)
RegDelete('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', $script)
EndIf
EndIf
EndFunc ;==>_AddMyIEVersion
找到问题了,我默认HTML打开是QQ浏览器,而AU3调用的是IE。所以解决方法是:
IE提示“Internet Explorer已限制此网页运行脚本或ActiveX控件”的解决办法
在页面html开始标签和head开始标签中间新增一行,添加以下代码:
<!-- saved from url=(0014)about:internet -->
或者
直接设置IE浏览器
工具=>Internet选项=>高级=>设置=>勾选“允许活动内容在‘我的电脑’的文件中运行*”
按照以上设置完成后,快捷键(Ctrl+Shift+Delete)清除IE浏览器的缓存,然后刷新即可
页:
[1]