Link to home
Start Free TrialLog in
Avatar of borgo
borgo

asked on

Minimizing a form

Hi Expert
With D5 I have lost the possibility to minimize the form without showing the animated window going down on the taskbar.
How Can I minimize my form without showing that animation ?
Can you understand me ?
Thank you.
Avatar of inthe
inthe

heh note also that calling Application.Minimize from a modal form does not work anymore in d5 ..
Hi

ShowWindow(Form1.Handle, SW_HIDE);

Best Regards
also, in delphi 4, application.restore; does not work, i had to do a showwindow(form1.handle,sw_restore) have inprise neglected this basic workings of a form?
Avatar of borgo

ASKER

Sorry but don't work
Avatar of borgo

ASKER

Madshi wrote:

Add this to your form:

  private
    procedure SysCommand(var Message: TWMSYSCOMMAND); message WM_SYSCOMMAND;

procedure TForm1.SysCommand(var Message: TWMSYSCOMMAND);
begin
  if Message.CmdType and $FFF0 = SC_MINIMIZE then begin
    Message.result:=0;
    Hide;
  end else inherited;
end;

And this work fine !!!
Thank you again Madshi.

Andrea.
Hmmm... Where did I post that? Can't remember...   :-)

Well, but that isn't the answer to your problem, is it?
Avatar of borgo

ASKER

Hi Madshi

Yes I use it to hide my form without showing the minimizing animation.
Any other good solutions are welcome :-)
Hmm... In the moment I have no other idea...
Avatar of borgo

ASKER

Ok, please Madshi reply for the points, the answer is one of yours.
Bye.

ASKER CERTIFIED SOLUTION
Avatar of Madshi
Madshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

procedure TMainForm.FormCreate(Sender: TObject);
begin
Application.OnMinimize := FormDblClick;
ShowWindow(Application.Handle,SW_Hide);
end;


procedure TMainForm.FormDblClick(Sender: TObject);
begin
Icons.Show; // taskbar icon..
ShowWindow(Handle, SW_HIDE);
ShowWindow(GetWindow (Handle, GW_OWNER),SW_HIDE);
ShowWindow(Application.Handle,SW_Hide);
end;
Avatar of borgo

ASKER

Many thanks to all of you who have helped me

Have a nice day.

Andrea.