coloniaie 发表于 2010-4-27 19:17:14

截图失败

本帖最后由 coloniaie 于 2010-5-12 21:00 编辑

_ScreenCapture_Capture(@MyDocumentsDir & "\winrar_Image1.jpg")
WinWait("WinRAR 3.93 简体中文版")
ControlClick("WinRAR 3.93 简体中文版","","Button2")
_ScreenCapture_Capture(@MyDocumentsDir & "\winrar_Image2.jpg")
WinWait("WinRAR 3.93 简体中文版")

ControlClick("WinRAR 3.93 简体中文版","","Button27")
_ScreenCapture_Capture(@MyDocumentsDir & "\winrar_Image3.jpg")
WinWait("WinRAR 3.93 简体中文版")

ControlClick("WinRAR 3.93 简体中文版","","Button1")
_ScreenCapture_Capture(@MyDocumentsDir & "\winrar_Image4.jpg")
WinWait("WinRAR 简体中文版")

Send("{Enter}")
_ScreenCapture_Capture(@MyDocumentsDir & "\winrar_Image5.jpg")
WinWait("WinRAR 简体中文版")
Send("{Enter}")



想截取安装过程中的图片,但是运行到第二张图,就停下来了,如果拿掉screen,就可以,求教了

lainline 发表于 2010-4-27 19:30:20

截图有时间问题
因为牵涉写入硬盘 第二次调用截屏函数时第一次的操作还没完成 数据就被第二次截屏数据打断
考虑引入少量延时或检查截屏文件已存在

afan 发表于 2010-4-28 00:40:30

截图时安装窗口失去了焦点,导致不继续。尝试在每个截图动作之后加入WinActivate()

wuweixian 发表于 2010-4-28 05:49:42

WinWaitActive:face (31):

boyhong 发表于 2010-4-28 07:32:09

我也想知道。。。
; 捕捉全屏
_ScreenCapture_Capture(@MyDocumentsDir & "\winrar_Image3.jpg")
为什么不行呢?

lynfr8 发表于 2010-4-28 23:21:05

Opt("TrayIconDebug",1)         ;0=无信息, 1=调试信息
跟踪一下脚本停在哪一行,再针对性解决就不难了
页: [1]
查看完整版本: 截图失败