Einzelnen Beitrag anzeigen

Daniel
(Co-Admin)

Registriert seit: 30. Mai 2002
Ort: Hamburg
13.919 Beiträge
 
Delphi 10.4 Sydney
 
#3
  Alt 16. Apr 2003, 09:32
Hallo,

erstmal Danke für den Hinweis. Ich habe erneut in die DOkumentation gesehen und festgestellt, dass es offenbar einen besseren Weg gibt, dieses Problem zu lösen: Man reagiert auf die Nachricht "WM_GETMINMAXINFO". Auszug aus der MSDN-Library:
Zitat von MSDN-Library:
The MINMAXINFO structure contains information about a window's maximized size and position and its minimum and maximum tracking size.
Das scheint auch gut zu funktionieren - selbst wenn die Taskleiste oben, rechts oder links sitzt.

Die Deklaration:
procedure WMGetMinMaxInfo(var Msg: TWMGetMinMaxInfo); message WM_GETMINMAXINFO; Die Implementation:
Delphi-Quellcode:
procedure TfrmMain.WMGetMinMaxInfo(var Msg: TWMGetMinMaxInfo);
var rect : TRect;
Begin
  SystemParametersInfo(SPI_GETWORKAREA, 0, @rect, 0);

  Msg.MinMaxInfo^.ptMaxSize.X:= rect.Right-rect.Left;
  Msg.MinMaxInfo^.ptMaxSize.Y:= rect.Bottom-rect.Top;

  Msg.MinMaxInfo^.ptMaxPosition.X:= rect.Left;
  Msg.MinMaxInfo^.ptMaxPosition.Y:= rect.Top;

  Msg.Result:= 0;
End;
Daniel R. Wolf
mit Grüßen aus Hamburg
  Mit Zitat antworten Zitat