【已解决】求助: 请问au3可以实现在program file search功能吗?想达到效果如附档
本帖最后由 梦想 于 2017-9-19 09:10 编辑#include <MsgBoxConstants.au3>
Run ("control.exe Appwiz.cpl")
Local $search = WinWait("", "", 10)
;Sleep (2000)
Local $focus = ControlFocus($search, "", "DirectUIHWID1")
MsgBox ($MB_SYSTEMMODAL, "", "C:" & $focus)
Local $uu = ControlSend($search, "", "DirectUIHWID1", "Bonjour")
MsgBox ($MB_SYSTEMMODAL, "", "C:" & $uu)
Sleep (2000)
WinClose($search)
请问小弟这样写,为什么不成功呢?希望得到指导,感谢
想达到效果如附档图: 回复 1# 梦想
DirectUIHWND的控件基本是虚拟控件,目前好像没有什么好的方法去控制 **** Hidden Message *****
win7 32 测试好像没问题
{:face (356):}多谢楼上哥们,,俺比较少玩自动化方面的东东,无知见解见笑了。。
你用的那个udf没有下载,,感觉内置函数能达到的目的用udf有点性能浪费。。所以稍微改了下
#cs
Code by ACN--zghwelcome
modify yamakawa
#ce
Run ("control.exe Appwiz.cpl")
Sleep(2000)
$hWnd = WinGetHandle('','')
If $hWnd = 0 Then
ConsoleWrite("$hwnd is 0" & @CRLF)
Exit
EndIf
$hWnd_DirectUIHWND = ControlGetHandle($hWnd,'','')
If $hWnd_DirectUIHWND = 0 Then
ConsoleWrite("$hwnd_directuihwnd is 0" & @CRLF)
Exit
EndIf
$sSize = ControlGetPos($hWnd_DirectUIHWND,'','')
If @error Then
ConsoleWrite("$ssize is 0" & @CRLF)
Exit
EndIf
ControlClick($hWnd_DirectUIHWND,'','','left',2,$sSize-10,10)
ControlSend($hWnd_DirectUIHWND,"","", 'Apple')
ConsoleWrite("Finished!" & @CRLF) 回复 4# yamakawa
之前 ControlSend 对文件夹测试时,经常失效或异常,所以用了别人的UDF 感谢感谢,知道自己的问题点在哪里,感谢 回复 4# yamakawa
请问一下,$sSize-10,10 这个是绝对坐标吗? 是怎么来的呢?
ControlClick($hWnd_DirectUIHWND,'','','left',2,$sSize-10,10) Local $e = WinGetHandle ("", "")
; MsgBox($MB_SYSTEMMODAL, "", $e)
Local $button = ControlGetHandle ($e, "", "")
;MsgBox($MB_SYSTEMMODAL, "", $button)
Local $position = ControlGetPos($button, "", "")
;MsgBox($MB_SYSTEMMODAL, "", "Position: " &$position & ", " &$position & @CRLF & "Size: " &$position & ", " & $position)
ControlClick ($button, "", "", "right", 1, $position-40, 15)
为什么不能点击OK button?
32658 ControlClick ("Confirm Uninstall", "", "")
根据文本点击也不行 ControlClick ("Confirm Uninstall", "", "")
根据文本点击也不行
页:
[1]