| Windows下有一個(gè)函數(shù)AnimateWindow,在Delphi自帶的Win32 API
            Help中是找不到的.你可以在Delphi的編輯器中輸入windows.等待代碼向?qū)С鰜?繼續(xù)輸入AnimateWindow就能看到確實(shí)是存在的Win32
            API,它的功能是在顯示或者關(guān)閉窗體的時(shí)候產(chǎn)生動(dòng)畫,如從左向右開屏,從中心向周圍開屏等.語法:function AnimateWindow(hWnd:
            HWND; dwTime: DWORD; dwFlags: DWORD): BOOL; stdcall;
 參數(shù):hWnd :
            想要顯示動(dòng)畫窗體的句柄
 dwTime : 動(dòng)畫時(shí)間數(shù),單位毫秒
 dwFlags : 顯示方式,取值如下定義
 1.AW_HOR_POSITIVE = $00000001; // 從左向右開屏
 2.AW_HOR_NEGATIVE = $00000002;
            // 從右向左開屏
 3.AW_VER_POSITIVE = $00000004; // 從上向下開屏
 4.AW_VER_NEGATIVE = $00000008; // 從下向上開屏
 5,AW_CENTER =
            $00000010;        // 從中心向四周擴(kuò)展,在關(guān)閉動(dòng)畫中則為從四周向中心收縮
 6.AW_HIDE =
            $00010000;          // 關(guān)閉時(shí)候與前面的定義組合使用,如AW_HIDE or AW_CENTER
 7.AW_ACTIVATE = $00020000;      // 與1-5組合,開屏使用
 8.AW_SLIDE =
            $00040000;         // 與1-5 + 6/7 組合,產(chǎn)生滑行效果
 9.AW_BLEND =
            $00080000;         // Win2000下使用,淡入淡出效果
 例子:
 unit
            Unit1;
 
 interface
 
 uses Windows, Messages, SysUtils, Classes,
            Graphics, Controls, Forms, Dialogs,
 StdCtrls, ComCtrls;
 
 type
 TForm1 = class(TForm)
 procedure FormCloseQuery(Sender: TObject; var
            CanClose: Boolean);
 procedure FormCreate(Sender: TObject);
 private
 { Private declarations }
 public
 { Public declarations
            }
 end;
 
 var Form1: TForm1;
 
 implementation
 
 {$R
            *.DFM}
 
 procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose:
            Boolean);
 begin
 AnimateWindow(handle,200,AW_HIDE+AW_CENTER);
 end;
 
 procedure
            TForm1.FormCreate(Sender: TObject);
 begin
 AnimateWindow(handle,200,AW_CENTER);
 end;
 
 end.
 |