Einzelnen Beitrag anzeigen

venice2
(Gast)

n/a Beiträge
 
#2

AW: [FMX] Ereignis bei Restore?

  Alt 2. Apr 2020, 15:24
Anstelle eines Timer kannst du doch die Message WM_WINDOWPOSCHANGING auswerten und entsprechend darauf reagieren.

Delphi-Quellcode:
type
  TForm1 = class(TForm)
  private
    procedure WMWindowPosChanging(var Message: TWMWindowPosChanging); message WM_WINDOWPOSCHANGING;
  end;

implementation

const
  SWP_STATECHANGED = $8000;

procedure TForm1.WMWindowPosChanging(var Message: TWMWindowPosChanging);
begin
  inherited;
  if (Message.WindowPos^.flags and (SWP_STATECHANGED or SWP_FRAMECHANGED)) <> 0 then
  begin
    if (Message.WindowPos^.x < 0) and (Message.WindowPos^.y < 0) then
    // State is Maximized
     ShowMessage('Window state is about to change to MAXIMIZED');
    // or do what your want so is maximized again.
  end;
end;
EDIT:
Du kannst auch mit
if not IsZoomed(MainHandle) then

prüfen ob das Fenster nicht Maximiert ist.

Geändert von venice2 ( 2. Apr 2020 um 15:57 Uhr)
  Mit Zitat antworten Zitat