Func Start()
代码奉上,起因是想用码栈控制IE实现类似PPT播放的功能。
$url = "D:\src\test.html"
$ie = J_IE_Create($url, "", "", "")
J_Windows($ie, "最大化")
$htmlContent_1 = '<!DOCTYPE html><html><head><title>Test</title></head><body><div id="Layer1" style="position:absolute;width:100%;height:100%;z-index:-1"><img src="'
$htmlMid = 'D:\src\images\幻灯片'
$htmlContent_2 = '.jpg" height="100%" width="100%"/></body></html>'
$maxSlide = 8
While 1
$count = 1
$htmlContent = $htmlContent_1 & $htmlMid & $count & $htmlContent_2
J_File_Write($url, $htmlContent, "覆盖")
J_IE_Link($ie, $url)
While 1
If _IsPressed("01") Or _IsPressed("4E") Or _IsPressed("27") Then
$count = $count + 1
If $count > $maxSlide Then
$count = $maxSlide
EndIf
$htmlContent = $htmlContent_1 & $htmlMid & $count & $htmlContent_2
J_File_Write($url, $htmlContent, "覆盖")
J_IE_Link($ie, $url)
ElseIf _IsPressed("50") Or _IsPressed("25") Then
$count = $count - 1
If $count = 0 Then
$count = 1
EndIf
$htmlContent = $htmlContent_1 & $htmlMid & $count & $htmlContent_2
J_File_Write($url, $htmlContent, "覆盖")
J_IE_Link($ie, $url)
ElseIf _IsPressed("1B") Then
J_Windows($ie, "最小化")
ElseIf _IsPressed("0D") Then
J_Windows($ie, "最大化")
ElseIf _IsPressed("2E") Then
J_IE_Close($ie)
Exit
EndIf
Sleep(50)
WEnd
WEnd
EndFunc ;==>Start
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。