|
- procedure TUDPMainForm.mytcpExecute(AThread: TIdPeerThread);
- var
- content:string;
- nLen: Integer;
- gg:string;
- begin
- //-----------------记录下SMO的线程-----------------
- // SM O_thread.threadID:=Athread;
- // SMO_thread.ip:='OK';
- //-------------------------------------------------
- try
- if not AThread.Terminated and AThread.Connection.Connected then
- begin
- //WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- if athread.Connection.Tag=8 then // 8 is for remote control ...
- begin
- athread.Connection.readbuffer(FCmdBuf, SizeOf(TCtlCmd));
- if true then
- begin
- if true then
- begin
- FCmdRec := 0;
- try
- Move(FCmdBuf[0], FCmd, SizeOf(TCtlCmd));
- if FCmd.Cmd in [1..7] then
- begin
- FPoint := Point(FCmd.X, FCmd.Y);
- SetCursorPos(FCmd.X, FCmd.Y);
- SetCapture(WindowFromPoint(FPoint));
- end;
- case FCmd.Cmd of
- 1: ;//mouse move
- 2: mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
- 3: mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
- 4: mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);
- 5: mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0);
- 6:
- begin
- mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
- mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
- end;
- 7:
- begin
- mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);
- mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0);
- end;
- 8: keybd_event(Byte(FCmd.X), 0, 0, 0);
- 9: keybd_event(Byte(FCmd.X), 0, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0);
- end;
- except
- end;
- end;
- end;
- exit;
- end;
- //WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- content:=athread.Connection.ReadLn(LF,10);
- if trim(content)='$REMOTE then
- begin
- athread.Connection.Tag:=8;
- syant:=TScreenSpy.Create(athread.Connection);
- syant.Resume;
- exit;
- end;
- IF (TRIM(CONTENT)='@SYANT@') OR (TRIM(CONTENT)='') THEN
- BEGIN
- application.ProcessMessages;
- exit;
- END;
- UDPMainForm.Writelog('=='+content);
- TCP_message:=content;
- show_info('(TCP)有收到消息: '+content);
- athread.Synchronize(TCP_get_core);
- end;
- except
- end;
- end;
复制代码 |
|