本帖最后由 kongzhuxin 于 2013-5-20 08:21 编辑
本想在选中的文件夹(文件夹名称“www.yimuhe.com-冰点还原7.21.20.3447支持服务器_2TB大硬盘,”比较长)右键点击,不料鼠标却跑了,跑到文件夹名称为“FoxitPDFEditor220205fix-LDR”,,附源程序,麻烦好心人给与解答,谢谢!#include <GuiListView.au3>
; Opt("MouseCoordMode", 0)
Local $hWnd, $hCtrl, $aText
$hWnd = WinGetHandle("本地磁盘 (F:)")
$hCtrl = ControlGetHandle($hWnd, "", "SysListView321")
WinActivate($hWnd)
For $i = 0 to _GUICtrlListView_GetItemCount($hCtrl) - 1
$aText = _GUICtrlListView_GetItem($hCtrl, $i)
If IsArray($aText) And $aText[3] == "www.yimuhe.com-冰点还原7.21.20.3447支持服务器_2TB大硬盘" Then
_GUICtrlListView_SetItemSelected($hCtrl, $i, True, True)
ExitLoop
EndIf
Next
WinActivate("本地磁盘 (F:)","FolderView")
Sleep(1000)
$ctrl = ControlGetHandle("本地磁盘 (F:)","FolderView","SysListView321")
$FindItem=ControlListView($hWnd,'','SysListView321','FindItem','www.yimuhe.com-冰点还原7.21.20.3447支持服务器_2TB大硬盘')
$seIconX=_GUICtrlListView_GetItemPositionX($ctrl, $FindItem)
$seIconY=_GUICtrlListView_GetItemPositionY($ctrl, $FindItem)
MouseMove($seIconX+10,$seIconY+10)
MouseClick("right", $seIconX+10,$seIconY+10, 1)
|