| 
 | 
	
- function windowOperate()
 
 -     var dm_ret=0,XXX,YYY        
 
 -     //1.设置路径
 
 -     system.setcurrentpath(help.getrcpath("rc:"))
 
 -     //2.设置字库
 
 -     dm.SetDict(0,"坐标.txt")
 
 -     //3.查找窗口句柄
 
 -     hWnd=dm.FindWindow("TianLongBaBu WndClass","《天龙八部OL》")
 
 -     traceprint("hWnd=" & hWnd)
 
 -     //4.绑定窗口
 
 -     dm_ret=dm.BindWindow(hWnd,"dx","dx2","dx",0)
 
 -     if(dm_ret==1)
 
 -         traceprint("Bind success")
 
 -     else
 
 -         traceprint("Bind failed,error code=" & dm.GetLastError())
 
 -     endif  
 
 -     
 
 -     //5.实时读取坐标值
 
 -     while(true)        
 
 -         XXX=dm.Ocr(943,2,970,19,"fdff73-000000",1.0)
 
 -         YYY=dm.Ocr(965,3,1000,18,"fdff73-000000",1.0)
 
 -         statictext.settext("Static0",XXX & "," & YYY)
 
 -         help.sleep(100)
 
 -     endwhile
 
 - endfunction    
 
  复制代码 
 
 |   
 
 
 
 |