Recent

Author Topic: TrayIcon: Restore Form On Click?  (Read 5229 times)

kwanbis

  • New Member
  • *
  • Posts: 14
TrayIcon: Restore Form On Click?
« on: March 31, 2010, 12:56:50 am »
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?

 

TinyPortal © 2005-2018