找回密码
 加入
搜索
查看: 6558|回复: 8

[AU3基础] 【已解决】如何获取 窗口上的部分字符、文本? 帮帮忙 谢!

[复制链接]
发表于 2013-5-30 16:02:55 | 显示全部楼层 |阅读模式
本帖最后由 laomeng 于 2013-6-5 09:23 编辑
Local $USB = DriveGetDrive("REMOVABLE")
If @error Then
MsgBox(4096, "信息", "没有发现可移动磁盘")
EndIf

If $USB[0] = 16 Then
        _yunxing()
Else
        MsgBox(0,"信息","少于16个U盘,需要手动运行量产工具")
        Run( @ScriptDir & "\sm32Xtest_V06-7.exe")
    WinWaitActive("SMI Mass Production Tool","Factory Driver and HUB ")
    Send("{F5}")
        Exit
EndIf

Func _yunxing()
Run( @ScriptDir & "\sm32Xtest_V06-7.exe")
WinWaitActive("SMI Mass Production Tool","Factory Driver and HUB ")
Send("{F5}")
Send("{SPACE}")
EndFunc
如图 ,有办法获取图片中realdy  和 pass (右上角OK 框也可以)这两个标题吗?
我想做的是 去监视 这个量产工具上面16个port是否全部量产完成,如果完成了 我再插上16个U盘  然后自动进行量产 。如果在5分钟之内 没有检测到 16个U盘 那么执行
Else
        MsgBox(0,"信息","少于16个U盘,需要手动运行量产工具")
        Run( @ScriptDir & "\sm32Xtest_V06-7.exe")
    WinWaitActive("SMI Mass Production Tool","Factory Driver and HUB ")
    Send("{F5}")
        Exit
EndIf
PS:量产工具 SMI SM3257ENLT  上传太大了。  这个工具 好象不带 自动检测和自动烧录。 因为近期 要量产一大批U盘    所以请高手帮帮忙啊!

用窗口信息工具获取不到ready 相关文本/

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2013-5-30 16:20:15 | 显示全部楼层
真心看不懂
发表于 2013-5-31 15:10:48 | 显示全部楼层
先围观一下~~~
发表于 2013-6-4 07:59:32 | 显示全部楼层
怎么觉得量产手工也很快,listview有UDF函数的,找找吧
 楼主| 发表于 2013-6-4 17:44:35 | 显示全部楼层
回复 4# seniors


    TKS!UDF 里面 确实有,我获取不到窗口,所以不采用之前的方法了
我想使用倒计时  自动发送量产命令,但是怎么做到循环啊?如10-- 计时到0后  发送一个F5 然后又从10--0 这样
以下借用了前辈的代码:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Timers.au3>
 
$Window = GUICreate("工具将在以下时间刷新", 340, 194, 458, 25)
$Button = GUICtrlCreateButton("点击暂停(秒)(10)", 40, 100,270,40)
$Timer = _Timer_SetTimer($Window, 1000, "update")
GUISetState(@SW_SHOW)
 
Global $Check = 10
 
While 1
        $Msg = GUIGetMsg()
        Switch $Msg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button
                        If GUICtrlRead($Button) = "暂停中" Then 
                                $Timer = _Timer_SetTimer($Window, 1000, "update")
                        Else
                                _Timer_KillTimer($Window, $Timer)
                                GUICtrlSetData($Button,"暂停中")
                        EndIf
        EndSwitch
        Sleep(100)
WEnd
 
Func update($hWnd, $Msg, $iIDTimer, $dwTime)
        $Check -= 1
        GUICtrlSetData($Button, "点击暂停(" & $Check & ")"&"秒")
        If $Check = 0 Then
                _Timer_KillTimer($Window, $Timer)
               ;Run( @ScriptDir & "\sm32Xtest_V06-7.exe")
                           ;WinWaitActive("SMI Mass Production Tool","Factory Driver and HUB")
                           ;Send("{F5}")
        EndIf
EndFunc   ;==>update
发表于 2013-6-4 21:12:35 | 显示全部楼层
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Timers.au3>

$Window = GUICreate("工具将在以下时间刷新", 340, 194, 458, 25)
$Button = GUICtrlCreateButton("点击暂停(秒)(10)", 40, 100,270,40)

GUISetState(@SW_SHOW)

Global $Check = 10

While 1
        $Msg = GUIGetMsg()
        Switch $Msg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button
                        If GUICtrlRead($Button) = "点击暂停(秒)(10)" Then 
                                $Timer = _Timer_SetTimer($Window, 1000, "update")
                        Else
                                _Timer_KillTimer($Window, $Timer)
                                GUICtrlSetData($Button,"点击暂停(秒)(10)")
                                                                $Check = 10
                        EndIf
        EndSwitch
        Sleep(100)
WEnd

Func update($hWnd, $Msg, $iIDTimer, $dwTime)
        $Check -= 1
        GUICtrlSetData($Button, "点击暂停(" & $Check & ")"&"秒")
        If $Check = 0 Then
                _Timer_KillTimer($Window, $Timer)
                                GUICtrlSetData($Button,"点击暂停(秒)(10)")
                                $Check = 10
                                ;以下写你的
               ;Run( @ScriptDir & "\sm32Xtest_V06-7.exe")
                                ;WinWaitActive("SMI Mass Production Tool","Factory Driver and HUB")
                                ;Send("{F5}")
                                $Timer = _Timer_SetTimer($Window, 1000, "update")                   
        EndIf
EndFunc   ;==>update
发表于 2013-6-5 00:26:35 | 显示全部楼层
学习中,收下先
 楼主| 发表于 2013-6-5 09:20:48 | 显示全部楼层
回复 6# seniors


    解决了 ,谢!
发表于 2013-6-9 10:36:23 | 显示全部楼层
学习中,收下先
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-3-29 19:33 , Processed in 0.076837 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表