I have TTrayIcon, and this code:
procedure TForm1.FormWindowStateChange(Sender: TObject);
begin
if Form1.WindowState = wsMinimized then begin
(1) form1.WindowState := wsNormal;
form1.Hide;
Form1.ShowInTaskBar := stNever;
end;
end;
procedure TForm1.TrayIconClick(Sender: TObject);
begin
Form1.Show;
Form1.ShowInTaskBar := stAlways;
end;
Problem is that (1) makes the application always restore to non maximized mode.
But if i take it out, the application restores to a single line and i have to press restore button, at least on Windows 7.
Is this normal? Any solution?