說的是,測試了一下,基本可以達到我的要求,代碼修改後如下:
;取消全部選取
MsgBox(0,"","取消全部",3)
$hItemFound = _GUICtrlTreeView_FindItem($hWnd, "Dr.eye 譯典通程式")
_GUICtrlTreeView_ClickItem($hWnd,$hItemFound)
send("{space}")
;選取需要的功能
MsgBox(0,"","選取基本功能",2)
$hItemFound = _GUICtrlTreeView_FindItem($hWnd, "Dr.eye 譯典通 7.0 專業版基本功能")
_GUICtrlTreeView_ClickItem($hWnd,$hItemFound,"Left")
send("{space}")
MsgBox(0,"","取消桌布選項",2)
$hItemFound = _GUICtrlTreeView_FindItem($hWnd, "桌布")
_GUICtrlTreeView_ClickItem($hWnd,$hItemFound,"Left")
send("{space}")
MsgBox(0,"","選取自動翻譯",2)
$hItemFound = _GUICtrlTreeView_FindItem($hWnd, "自動翻譯")
_GUICtrlTreeView_ClickItem($hWnd,$hItemFound,"Left")
send("{space}")
MsgBox(0,"","取消MSN翻譯插件",2)
$hItemFound = _GUICtrlTreeView_FindItem($hWnd, "MSN翻譯插件")
_GUICtrlTreeView_ClickItem($hWnd,$hItemFound,"Left")
send("{space}")
MsgBox(0,"","選取完成",2)
send("!n")
以上代碼請結合上面的圖可以看出我的安裝要求。不過安裝完成後進行復查。發現還是會安裝MSN翻譯插件
同一腳本另一段卻完全正常,實現了我的要求(不安裝日華華日辭典)
$wText="選擇元件"
WinWait($wTitle,$wText)
If Not WinActive($wTitle,$wText) Then WinActivate($wTitle,$wText)
;;取得控件句柄
$hWnd=ControlGetHandle($wTitle, $wText, "SysTreeView321")
$hItemFound = _GUICtrlTreeView_FindItem($hWnd, "日華華日辭典")
_GUICtrlTreeView_ClickItem($hWnd,$hItemFound,"Left")
send("{space}")
send("!n")
我再修改代碼測試。感謝你的指教。 |