2009. március 11., szerda

How to force a form to stay iconized


Problem/Question/Abstract:

How to force a form to stay iconized

Answer:

If your application should be iconized from the beginning, set the for property WindowState to wsMinimized.

To keep a form iconized (and prevent a restore), add the following handler to your form class definition:


// e.g. the private section

procedure WMQueryOpen(var Msg: TWMQueryOpen); message WM_QUERYOPEN;

implementation

// ..

procedure TForm1.WMQueryOpen(var Msg: TWMQueryOpen);
begin
  Msg.Result := 0;
end;

Nincsenek megjegyzések:

Megjegyzés küldése