Animer une fenêtre (ex: Minimiser vers unTrayIcon)

{As an example I'll show how to show an animation that you can use to minimize
your application to the system tray area. This example doesn't actually minimize
the application, it only shows the animation.}

procedure TForm1.Button1Click(Sender: TObject);
var
FormRect,
TrayRect: TRect;
hTray: THandle;
begin
// Get handle of tray window
hTray := FindWindowEx(FindWindow('Shell_TrayWnd',nil),0,'TrayNot if yWnd',nil);

if hTray <> 0 then begin
// This is the source rect for the animation.
FormRect := BoundsRect;

// Get tray window's coordinates as a TRect. This will be the animation's destination
rect.
GetWindowRect(hTray,TrayRect);

if Not DrawAnimatedRects(Handle,IDANI_CAPTION,FormRect,TrayRect) then begin
MessageDlg('DrawAnimatedRects() failed!',mtError,[mbOK],0);
end;

end else begin
MessageDlg('Can''t get tray window handle!',mtError,[mbOK],0);
end;
end;

Ajouter un commentaire
Pseudo
Adresse email
Site internet (optionnel)
Votre commentaire
Fiche de l'article
Mise a jour27/08/2004
VisualisationVu 1698 fois
PublicInternaute zz
CategorieDelphi - Trucs et astuces - Surface
Auteur de l'article
SwissDelphiCenter SwissDelphiCenter
connecté le 02/11/2011
329 articles dans la section
Contacter l'auteur