Ver Mensaje Individual
  #2  
Antiguo 02-10-2017
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.265
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
A partir de la solución que se muestra por ejemplo en este hilo, puedes hacer algo como esto:

1) Crea un proyecto VCL nuevo
2) Coloca un Timer
3) Programa los eventos OnCreate y OnTimer con lo siguiente:

Código Delphi [-]
procedure TForm2.FormCreate(Sender: TObject);
begin
  VMess := FindWindow('Notepad', nil);
  Timer1.Interval := 50;
end;

procedure TForm2.Timer1Timer(Sender: TObject);
var
  Tam: TRect;
begin
  if vMess <> 0 then begin
    GetWindowRect(VMess, Tam);
    Self.Caption := 'Posición: ' + InttoStr(Tam.Left) + ' ; ' + IntToStr(Tam.Top) + ' - '
                    +'Tamaño: ' + IntToStr(Tam.Right - Tam.Left) + 'x' + IntToStr(Tam.Bottom - Tam.Top);
  end
end;

4) La variable debe estar definida como (global o como propiedad):

Código Delphi [-]
var
  VMess : HWND;

Debería resultar algo así:

__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita