佛山乐从行政服务中心:窗口特效向右渐渐缩短消失

来源:百度文库 编辑:偶看新闻 时间:2024/04/29 12:35:33

窗口特效向右渐渐缩短消失

//HmainWND 主窗口 HWND

AnimateWindow(HmainWND, 1000, AW_HIDE or AW_SLIDE or AW_HOR_POSITIVE);

DeskTopWnd := GetDesktopWindow();
DeskTopWnd := FindWindowEx(DeskTopWnd,0,'SysListView32', nil);

InvalidateRect(DeskTopWnd ,nil, true);

窗口特效像Winamp拖动窗口

Function WndProc(AWnd:HWND; message:UINT; wp:WPARAM; lp:LPARAM):LRESULT;stdcall;
begin
Result := 0;
case message of

WM_LButtonDown : BEGIN
ReleaseCapture;//窗体移动
SendMessage(AWND, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
END;

显示方式:
const
JC_HorPositive=$00000001;//从左到右
JC_HorNegative=$00000002;//从右到左
JC_VerNegative=$00000004;//从下到上
JC_VerPositive=$00000002;//从上到下
JC_Center=$00000010;//从中间到两边
JC_Blend=$00080000;//渐显窗体
然后调用user32.dll中的
function AnimateWindow(Wnd:HWND;dWTime,dwFlags:DWORD):Boolean;
example:
procedure TForm1.Formshow(Sender:TObject);
begin
AnimateWindow(handle,400,aw_Hor_Positive);
end;   

form以圆形的形式,从中间向四周扩散

unit unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
end;

var
Form1: TForm1;

implementation
{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
r:thandle;
i:integer;
begin
for i:=1 to trunc(width/1.414) do
begin
r:=CreateEllipticRgn(trunc(width/2)-i,trunc(height/2)-i,trunc(width/2)+i,trunc(height/2)+i);
SetWindowRgn(handle,r,true);
//Next one Line fixed by Aiming.
//Application.ProcessMessages;
sleep(10);
end;
end;