TC官方合作论坛

标题: 【有源码】万能多窗体同步 [打印本页]

作者: 翔林小刚    时间: 2012-2-25 19:51
标题: 【有源码】万能多窗体同步

#include"varlist.t"
namespace 多窗体同步
dm=com("dm.dmsoft")
hwnd,keycode
//********************************//
//***********线程任务**************//
//********************************//
function beginsomething()
//多窗体同步.register()  //注册绑定
help.messagebox(convert.inttostr(keycode))
    while(true)
        k=keyboard.waitkey()
        help.sleep(100)
        if(k!=118)
          // dm.KeyPress(k)
          超级键盘.按键(k,10)
           help.sleep(20)
        endif
    endwhile
return true
endfunction
//********************************//
//***********开始按钮**************//
//********************************//
function start_click()
while (true)
  keycode=keyboard.waitkey()
                help.sleep(500)
                if(keycode==118)
   //hwnd=dm.GetMousePointWindow()
                        window.getmousemovewndhand()   
                        h=thread.beginthread("多窗体同步.beginsomething")
   varlist.addstr(h)
                else
                    多窗体同步.beginsomething()
  endif
endwhile
return true
endfunction
//********************************//
//***********退出按钮**************//
//********************************//
function exit_click()
//多窗体同步.free()
   多窗体同步.closeThead()
help.exit()
return true
endfunction
//********************************//
//********注册绑定*********//
//********************************//
function register()
    dm_ret = dm.BindWindow(hwnd,"dx","dx","dx",0)
    help.sleep(20)
    if (dm_ret==0)
        help.messagebox("大漠绑定失败")
        help.exit()
    endif
return true
endfunction
//********************************//
//********大漠解除绑定*********//
//********************************//
function free()
  // dm.UnBindWindow()
   help.sleep(500)
return true
endfunction
//********************************//
//********窗体销毁方法*********//
//********************************//
function destroy()
多窗体同步.exit_click()
return true
endfunction
//********************************//
//********关闭多线程*********//
//********************************//
function closeThead()
str=varlist.returnstr()
wz
  while(true)
   wz=str.findstr(str,"|")
                        thread.closethread(str.strsub(str,0,wz))
                        help.sleep(200)
   if (wz==-1)
    break
   else
    str=str.strcut(str,wz+1,true)
   endif
  endwhile
return true
endfunction

endnamespace


作者: cylhb    时间: 2012-2-25 19:54
很好很强大,鼠标部分呢,有便捷的调用么
作者: sazx    时间: 2012-7-19 11:19
好象是键盘,没鼠标啊
作者: scj2zxy    时间: 2012-9-2 17:22
学习
作者: 郑州小兵    时间: 2012-9-23 10:41
学习
作者: qzenghui    时间: 2012-9-24 11:52
请教 复制粘贴大法 有效果吗
作者: 254642432    时间: 2012-10-7 11:57
能发个 鼠标的就好了 ,期待中..............................
作者: zheng2001zhou    时间: 2012-11-11 00:06
4111111
作者: vankan    时间: 2014-3-26 01:31
总算看到一个
作者: vankan    时间: 2014-6-3 02:22

作者: 168168    时间: 2017-8-24 15:02
大漠的?有点看不懂




欢迎光临 TC官方合作论坛 (http://bbs.52tc.co/) Powered by Discuz! X3.1