Ver Mensaje Individual
  #1  
Antiguo 07-06-2006
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.107
Reputación: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Simular un clic en los botones (izquierdo, central y derecho) del ratón

Simula que se ha pulsado un botón del ratón, sea el izquierdo, el central (la rueda del ratón) o el derecho:

Código Delphi [-]
uses
  Windows;

type
  { Botones del ratón }
  TBotonesRaton = (brIzquierdo, brCentral, brDerecho);

procedure ClicBotonRaton(boton: TBotonesRaton);
begin
  case boton of
    brIzquierdo: begin
      mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
      mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
    end;
    brCentral: begin
      mouse_event(MOUSEEVENTF_MIDDLEDOWN,0,0,0,0);
      mouse_event(MOUSEEVENTF_MIDDLEUP,0,0,0,0);
    end;
    brDerecho: begin
      mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
      mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
    end;
  end;
end;
Responder Con Cita