本帖最后由 cfxqm 于 2010-11-29 00:06 编辑
我想编个股票自动交易程序,碰到个问题:编程往“证券代码”这一栏里写代码的时候,代码只是一闪就没了,而用键盘输入就有,我用程序中的几种方式都写不进去。是怎么回事呢?
软件代码:Const $winname = "招商证券全能版"
$gui = WinGetHandle($winname)
WinActivate($winname)
WinActive($winname)
$h_tree = ControlGetHandle($winname, "", "SysTreeView321")
$hEdit = ControlGetHandle($winname, "", "Edit5")
ControlFocus($winname,"","SysTreeView321")
ControlTreeView ($gui, "", $h_tree, "Expand", "Root")
ControlTreeView ($gui, "", $h_tree, "Select", "卖出")
Opt("MouseCoordMode", 2)
MouseMove ( 30, 710 )
MouseClick("left") ;点“卖出”
ControlFocus($winname,"","Edit5")
;ControlSend($winname, "", "Edit5", "600143" )
;ControlSetText($winname, "", "Edit5", "600143" ,1)
_GUICtrlEdit_SetText($hEdit,"600143")
;Send('600143')
;Send('{Enter}')
图片如下:
|