$Text=ControlGetText ( "招商全能版V6.45 -", "", 65281)
$Text2=StringRight ( $Text,4 )
$file =fileopen("1.ini" ,0)
$read=fileread($file)
$c=StringMid($read,StringInStr($read,$Text2)+4,6)
MsgBox(0, "Rightmost 3 characters are:", $c)
先谢谢各位帮忙,又研究了半天,我用这个可以取得,但有错误,就是如果招商全能版V6.45 没有运行,它还是会去取数据,取第一行第四个字开始,不知道什么原因。下面这个源码为什么不运行?谁帮我看看
Func Button1Click();强卖
#region --- ScriptWriter generated code Start ---
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",2)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
WinWait("网上交易","")
If Not WinActive("网上交易","") Then WinActivate("网上交易","")
WinWaitActive("网上交易","")
Send("{F2}")
$Text=ControlGetText ( "飞狐交易师 - ", "", 65281 )
$Text2=StringRight ( $Text,6 )
Sleep(300)
ControlClick ( "网上交易", "", 12005,"left",1)
If $Text2>0 Then
Send($Text2)
Sleep(480)
$Text3=ControlGetText ( "飞狐-通达信类下单", "", "Edit1" )
Send($Text3);输入价格
Sleep(150)
Send("{ENTER}")
$Text18=ControlGetText ( "飞狐-通达信类下单", "", "Edit2" )
Send($Text18);输入数量
Sleep(180)
Send("{ENTER}");交易确定前的回车
Sleep(200)
If Not WinActive("提示","") Then ;WinActivate("提示","")
Sleep(200)
Send("{ENTER}");交易确定
Sleep(200)
WinWait("提示","")
If Not WinActive("提示","") Then WinActivate("提示","")
WinWaitActive("提示","")
Send("{ENTER}");提交提示确定
;ElseIf $Text8<0 Then
Else
;MsgBox ("{ENTER}" , "提示", "没有持仓,回车取消提示!" ,1000 )
Send("{ENTER}");判断空仓提示确定
Endif
Else
MsgBox ("{ENTER}" , "提示", "行情软件不匹配,回车取消提示!" ,1000 )
Endif
ControlSetText ( "飞狐-通达信类下单", "", "Edit1","" )
ControlSetText ( "飞狐-通达信类下单", "", "Edit2","" )
#endregion --- ScriptWriter generated code End ---
EndFunc
Func Button2Click()
#region --- ScriptWriter generated code Start ---
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",2)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
$Text=ControlGetText ( "飞狐交易师 - ", "", 65281 )
$Text2=StringRight ( $Text,6 )
Sleep(300)
WinWait("网上交易","")
If Not WinActive("网上交易","") Then WinActivate("网上交易","")
WinWaitActive("网上交易","")
Send("{F1}")
Sleep(300)
;ControlClick ( "网上交易", "", 12005,"left",1)
If $Text2>0 Then
Send($Text2)
Sleep(480)
$Text3=ControlGetText ( "飞狐-通达信类下单", "", "Edit1" )
Send($Text3)
Send("{ENTER}");第一个回车
Sleep(150)
$Text18=ControlGetText ( "飞狐-通达信类下单", "", "Edit2" )
Send($Text18)
Sleep(180)
Send("{ENTER}");第二个回车
Sleep(200)
Send("{ENTER}");交易确定
Sleep(200)
Send("{ENTER}");提示确定
Sleep(180)
Send("{ENTER}")
Else
MsgBox ("{ENTER}" , "提示", "行情软件不匹配,控件不对,回车取消提示!" ,1000 )
EndIf
ControlSetText ( "飞狐-通达信类下单", "", "Edit1","" )
ControlSetText ( "飞狐-通达信类下单", "", "Edit2","" )
#endregion --- ScriptWriter generated code End ---
EndFunc
Func Button5Click();仓位
#region --- ScriptWriter generated code Start ---
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",2)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
WinWait("网上交易","")
If Not WinActive("网上交易","") Then WinActivate("网上交易","")
WinWaitActive("网上交易","")
;Send("{F2}")
MouseMove(70,130)
MouseDown("left")
MouseUp("left")
#endregion --- ScriptWriter generated code End ---
EndFunc
Func Button6Click()
#region --- ScriptWriter generated code Start ---
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",2)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
WinWait("网上交易","")
If Not WinActive("网上交易","") Then WinActivate("网上交易","")
WinWaitActive("网上交易","")
Send("{F3}")
Sleep(800)
If WinActive("提示","") Then
Send("{ENTER}")
Else
Endif
#endregion --- ScriptWriter generated code End ---
EndFunc
Func Button7Click()
#region --- ScriptWriter generated code Start ---
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",2)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
WinWait("网上交易","")
If Not WinActive("网上交易","") Then WinActivate("网上交易","")
WinWaitActive("网上交易","")
Send("{F10}")
Sleep(1800)
Send("{ENTER}")
#endregion --- ScriptWriter generated code End ---
EndFunc
Func Button8Click()
#region --- ScriptWriter generated code Start ---
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",2)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
WinWait("网上交易","")
If Not WinActive("网上交易","") Then WinActivate("网上交易","")
WinWaitActive("网上交易","")
Send("{F3}")
Sleep(800)
If Not WinActive("提示","") Then
Sleep(200)
ControlClick ( "网上交易", "", 14,"left",2)
Sleep(200)
ControlClick ( "网上交易", "", 1136,"left",2)
WinWait("提示","确定")
If Not WinActive("提示","确定") Then WinActivate("提示","确定")
WinWaitActive("提示","确定")
Sleep(200)
Send("{ENTER}")
Sleep(300)
Send("{ENTER}")
Sleep(680)
Send("{ENTER}")
Sleep(200)
Send("{ENTER}")
Else
;MsgBox ("{ENTER}" , "提示", "没有挂单,回车取消提示!" ,1000 )
Send("{ENTER}")
Endif
#endregion --- ScriptWriter generated code End ---
EndFunc
Func Form1_1Close()
Exit
EndFunc
Func Form1_1Maximize()
EndFunc
Func Form1_1Minimize()
EndFunc
Func Form1_1Restore()
EndFunc
Func Input1Change()
EndFunc
Func Input2Change()
EndFunc
Func Label1Click()
EndFunc
Func Label2Click()
EndFunc |