SubSeven、冰河、PC AnyWhere,你想做一个超越这些很好用的软件?

解决方案 »

  1.   

    这种软件属于远程控制问题,我写过几篇你参考一下
    http://www.csdn.net/expert/topic/698/698610.xml?temp=.7201044
    http://www.csdn.net/expert/topic/674/674607.xml?temp=.564831
      

  2.   

    cutelocust(风),非常感谢您!我又深受启发。
    有人跟我说,可以把被控方的电脑桌面的图象截取,然后以很短的时间间隔发送到控制方,同时截获控制方的鼠标和键盘消息并发回被控方,最后在被控方回放这些鼠标和键盘消息。
    不知道我的理解对不对?你的贴子里主要讲的是传输的实现,如果我得到了这些鼠标和键盘消息,我该怎样回放它们呢?
      

  3.   

    我这里有一篇关于hook监视键盘的例子,希望对你有帮助
    一、Hook(钩子)的实现: ---- Hook是应用程序在Microsoft Windows 消息处理过程中设置的用来监控消息流并且 处理系统中尚未到达目的窗口的某一类型消息过程的机制。如果Hook过程在应用程序中 实现,若应用程序不是当前窗口时,该Hook就不起作用;如果Hook在DLL中实现,程序在 运行中动态调用它,它能实时对系统进行监控。根据需要,我们采用的是在DLL中实现H ook的方式。 ---- 1.新建一个导出两个函数的DLL文件,在hookproc.pas中定义了钩子具体实现过程 。代码如下: library keyspy; uses windows,  messages, hookproc in 'hookproc.pas'; exports setkeyhook, endkeyhook; begin nexthookproc:=0; procsaveexit:=exitproc; exitproc:=@keyhookexit; end. 2.在Hookproc.pas中实现了钩子具体过程: unit hookproc; interface uses Windows, Messages, SysUtils, Controls, StdCtrls; var nexthookproc:hhook; procsaveexit:pointer; function    keyboardhook(icode:integer;wparam:wparam;                lparam:lparam):lresult;stdcall;export; function     setkeyhook:bool;export;//加载钩子 function     endkeyhook:bool;export;// 对 钩子 procedure  keyhookexit;far; const afilename='c:\debug.txt';//将键盘输入动作写入文件中 var debugfile:textfile; implementation function keyboardhookhandler(icode:integer;wparam:wparam; lparam:lparam):lresult;stdcall;export; begin if icode<0 then begin result:=callnexthookex(hnexthookproc,icode,wparam,lparam); exit; end; assignfile(debugfile,afilename); append(debugfile); if getkeystate(vk_return)<0 then begin writeln(debugfile,''); write(debugfile,char(wparam)); end else write(debugfile,char(wparam)); closefile(debugfile); result:=0; end; function endkeyhook:bool;export; begin if nexthookproc<>0 then   begin unhookwindowshookex(nexthookproc); nexthookproc:=0; messagebeep(0);  end; result:=hnexthookproc=0; end; procedure keyhookexit;far; begin if nexthookproc<>0 then endkeyhook; exitproc:=procsaveexit; end; end. ---- 二、Win95/98使用任务栏右方指示区来显示应用程序或工具图标对指示区图标的操 作涉及了一个API函数Shell_NotifyIcon,它有两个参数,一个是指向TnotifyIconData 结构的指针,另一个是要添加、删除、改动图标的标志。通过该函函数将应用程序的图 标添加到指示区中,使其作为图标运行,增加专业特色。当程序起动后,用鼠标右键点击 图标,则弹出一个菜单,可选择sethook或endhook。 unit kb; interface uses Windows, Messages, SysUtils, Classes,  Graphics, Controls, Forms, Dialogs, StdCtrls, Menus,shellapi; const icon_id=1; MI_iconevent=wm_user+1;//定义一个用户消息 type TForm1 = class(TForm) PopupMenu1: TPopupMenu; sethook1: TMenuItem; endhook1: TMenuItem; N1: TMenuItem; About1: TMenuItem; Close1: TMenuItem; Gettext1: TMenuItem; procedure FormCreate(Sender: TObject); procedure sethook1Click(Sender: TObject); procedure endhook1Click(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure Close1Click(Sender: TObject); private { Private declarations } nid:tnotifyicondata; normalicon:ticon; public { Public declarations } procedure icontray(var msg:tmessage); message mi_iconevent; end; var Form1: TForm1; implementation {$R *.DFM} function setkeyhook:bool;external 'keyspy.dll'; function endkeyhook:bool;external 'keyspy.dll'; procedure tform1.icontray(var msg:tmessage); var pt:tpoint; begin if msg.lparam=wm_lbuttondown then sethook1click(self); if msg.LParam=wm_rbuttondown then begin getcursorpos(pt); setforegroundwindow(handle); popupmenu1.popup(pt.x,pt.y); end; end; procedure TForm1.FormCreate(Sender: TObject); begin normalicon:=ticon.create; application.title:=caption; nid.cbsize:=sizeof(nid); nid.wnd:=handle; nid.uid:=icon_id; nid.uflags:=nif_icon or nif_message or nif_tip; nid.ucallbackmessage:=mi_iconevent; nid.hIcon :=normalicon.handle; strcopy(nid.sztip,pchar(caption)); nid.uFlags:=nif_message or nif_icon or nif_tip; shell_notifyicon(nim_add,@nid); SetWindowLong(Application.Handle,  GWL_EXSTYLE,WS_EX_TOOLWINDOW); end; procedure TForm1.sethook1Click(Sender: TObject); begin setkeyhook; end; procedure TForm1.endhook1Click(Sender: TObject); begin endkeyhook; end; procedure TForm1.FormDestroy(Sender: TObject); begin nid.uFlags :=0; shell_notifyicon(nim_delete,@nid); end; procedure TForm1.Close1Click(Sender: TObject); begin application.terminate; end;