|
本帖最后由 lion.lee 于 2011-6-6 20:54 编辑
背景:该小程序是为了解决局域网访问时用户名一栏出现灰色guest对话框,目前在win7中文版中测试。
问题描述:
1、运行gpedit.msc后组策略弹出来非常慢,以至于被逼无奈只好sleep(3000),或使用msgbox强制延时;ShellExecute("gpedit.msc")
Sleep(3000)
WinWaitActive("[tile:;CLASS:MMCMainFrame]", "")
;MsgBox(0,0,"打开了!")
2、可能是_GUICtrlListView_ClickItem算法比较复杂需要时间,中间没有强制sleep(1000)的话,运行非常不稳定,经常错误点击;
3、有没有别的命令我不喜欢用含click的命令,请问各位大侠有没有别的命令可以代替?
4、_GUICtrlListView_FindItem($hWnd, $iStart, ByRef $tFindInfo[, $sText = ""])这条命令的帮助看不懂,大侠们有没有实际的例子给小菜看看?帮助里的例子实在看不懂:$tInfo = DllStructCreate($tagLVFINDINFO)
DllStructSetData($tInfo, "Flags", $LVFI_PARAM)
DllStructSetData($tInfo, "Param", 1234)
$iI = _GUICtrlListView_FindItem($hListView, -1, $tInfo)#Include <GuiListView.au3>
ShellExecute("gpedit.msc")
Sleep(3000)
WinWaitActive("[tile:;CLASS:MMCMainFrame]", "")
;MsgBox(0,0,"打开了!")
$handle = ControlGetHandle("[CLASS:MMCMainFrame]","","SysListView321")
_GUICtrlListView_ClickItem($handle,0,"left",False,2)
Sleep(1000)
_GUICtrlListView_ClickItem($handle,1,"left",False,2)
Sleep(1000)
_GUICtrlListView_ClickItem($handle,3,"left",False,2)
Sleep(1000)
_GUICtrlListView_ClickItem($handle,1,"left",False,2)
Sleep(1000)
_GUICtrlListView_ClickItem($handle,2,"left",False,2)
Sleep(1000)
_GUICtrlListView_ClickItem($handle,49,"left",False,2)
WinWaitActive("[class:#32770]","")
ControlCommand("[class:#32770]","","ComboBox1","SelectString","经典")
ControlClick("[class:#32770]","","Button2")
|
|