***************************************************************** * Neveprise Inc. Delphi FAQ * ***************************************************************** * Section: Desktop Topic: Tracing windows * * Created: July 27th, 1999 Revised: July 27th, 1999 * * Updates: www.neveprise.de Info: support@neveprise.de * ***************************************************************** Q: How can I apply window animation fx to ALL my forms on open / close or on other components, such as Office does? A: This tracer effect appears in some 'modern' apps when a form opens, thus it seems to grow until its final size and versa. In fact, Windows just draws another rectangle step by step until it has reached its correct format; then the form itself is displayed. procedure ShowWindowH(Show: boolean; Win: TWinControl); var StartPos, EndPos: TRect; MPos: TPoint; begin //get mouse coordinates, so that the form comes from or moves back into //the mouse pointer GetCursorPos(MPos); if Show=false then begin //no, we wanna hide the form, panel etc. with Win do begin Hide; //hide the real one StartPos:=Rect(Left,Top,Left+Width,Top+Height); //get current position etc. EndPos:=Rect(MPos.X,MPos.Y,MPos.X,MPos.Y); //shall shrink to mouse DrawAnimatedRects(Handle,3,StartPos,EndPos); //trace it end; end else begin with Win do begin //better show it... Hide; //just to go shure EndPos:=Rect(Left,Top,Left+Width,Top+Height); StartPos:=Rect(MPos.X,MPos.Y,0,0); DrawAnimatedRects(Handle,3,StartPos,EndPos); Show; end; end; end; Blazko