1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| procedure TForm3.OuSuisJe;
var
Pt : TPoint;
ARect : TRect;
begin
// Recupère le rectangle délimitant toute la fenêtre relativement à l'écran
GetWindowRect(Self.Handle,ARect);
// Ici le calcul de Pt donne ClientOrigin !
Pt := Point(0,0);
Pt := ClientToScreen(Pt);
ShowMessage('Ma zone cliente est en ('+
IntToStr(ClientOrigin.X)+','+IntToStr(ClientOrigin.Y)+')'+
' et mesure '+IntToStr(self.ClientWidth)+'x'+IntToStr(ClientHeight)+
#13#10#13#10+
'Par contre je suis en ('+
IntToStr(ARect.Left)+','+ IntToStr(ARect.Top)+')'+
' et mesure '+IntToStr(ARect.Right-ARect.Left)+'x'+
IntToStr(ARect.Bottom-ARect.Top)+' en tenant compte des bordures et du titre !');
end; |
Partager