Ver Mensaje Individual
  #2  
Antiguo 28-12-2013
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola look

Fijate si te sirve de este modo.

Cliente:
Código Delphi [-]
...
procedure TfrmClient.FormClick(Sender: TObject);
var
  P: TPoint;
begin
  P := ScreenToClient(Mouse.CursorPos);
  if ClientSocket1.Active then
    ClientSocket1.Socket.SendBuf(P, SizeOf(P));
end;

Servidor:
Código Delphi [-]
...
procedure TfrmServer.ServerSocket1ClientRead(Sender: TObject;  Socket: TCustomWinSocket);
var
  i:integer;
  P: TPoint;
  si: array[0..1] of TInput;
begin
  with ServerSocket1.Socket do
  begin
    for i := 0 to ActiveConnections-1 do
    begin
      Connections[i].ReceiveBuf(P, SizeOf(P));
      P := ClientToScreen(P);
      SetCursorPos(P.X, P.Y);
      ZeroMemory(@si, sizeof(si));
      si[0].Itype := INPUT_MOUSE;
      si[0].mi.dwFlags := MOUSEEVENTF_LEFTDOWN;
      si[1].Itype := INPUT_MOUSE;
      si[1].mi.dwFlags := MOUSEEVENTF_LEFTUP;
      SendInput(2, si[0], SizeOf(TInput));
    end;
  end;
end;


// Ejemplo de la captura
procedure TfrmServer.FormClick(Sender: TObject);
var
  P: TPoint;
begin
  P := ScreenToClient(Mouse.CursorPos);
  Caption := Format('Click en: %d %d',[P.X, P.Y]);
end;

Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita