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ú).