Ver Mensaje Individual
  #4  
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
Puedes utilizar la API GetClientRect.
Sustituye el código anterior por este:
Código Delphi [-]
  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);

    WINAPI.Windows.GetClientRect(VMess, TamClient);
    Self.Caption := Self.Caption + ' -  Cliente => ' +
                    'Posición: ' + InttoStr(TamClient.Left) + ' ; ' + IntToStr(TamClient.Top) + ' - '
                    +'Tamaño: ' + IntToStr(TamClient.Right - TamClient.Left) + 'x' + IntToStr(TamClient.Bottom - TamClient.Top);

  end
  else begin
    Self.Caption := 'Ventana de  no encontrada';
  end;

Si repites el ejemplo obtendrás esto:




Para una ventana de 640x480 su área cliente es: 624x421, que parece bastante lógico.
La diferencia de ancho son 16 pixels (de los bordes decho e izquierdo) y la diferencia de alto es 59 (del borde inferior y del título y del menú).
__________________
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