sanye000001 发表于 2010-10-25 14:03:05

winexists可以检查窗口的存在,那控件怎么检查

winexists可以检查窗口的存在,请问用什么来检查控件是否存在呢?检查到控件的存在再执行语句,要怎么写?比如检查到Button1的存在,然后执行程序,改怎么写?请指教。

tpj633 发表于 2010-10-25 15:04:39

$btnTxt=ControlGetText ( "窗口标题", "窗口文本", Button1)
If $btnTxt!="" Then
    要执行的代码
EndIf
方法应该比较多,建议看一下帮助文档中的Controls

afan 发表于 2010-10-25 15:06:19

Local $h = ControlGetHandle( "窗口标题", "窗口文本", 'Button1')
If Not @Error Then Msgbox(0, 0, 'Button1存在')

netegg 发表于 2010-10-25 15:14:29

_winapi_enumchildwindow

pusofalse 发表于 2010-10-25 15:28:37

控件也是窗口,同样可以用WinExists来检查。

xianhou 发表于 2010-10-25 15:34:58

原来还有这么多的方法。

mybkc 发表于 2010-10-26 22:45:18

学习了!~!
页: [1]
查看完整版本: winexists可以检查窗口的存在,那控件怎么检查