随笔 - 110  文章 - 28 评论 - 26 

留言簿(1)

随笔分类(103)

随笔档案(110)

文章分类(25)

文章档案(28)

新闻档案(3)

友情连接

  • 小蜜蜂
  • 马氏膏药网
  • 淋巴结肿大,淋巴结核,淋巴结炎 乳腺增生,小叶增生 颈椎病,腰椎病,腰间盘突出 马氏淋巴消炎贴,马氏增生散结贴,马氏关节肌肉贴
  • 黑客基地
  • 全球最大的黑客门户网站

最新随笔

积分与排名

  • 积分 - 143508
  • 排名 - 44

最新评论

阅读排行榜

评论排行榜

新建工程放三个TTimer
三个TTimer中  1和3是:
    Interval = 400
2是:Interval = 150


implementation

{$R *.dfm}
var
p:trect;

procedure TForm1.Timer1Timer(Sender: TObject);
var
d:tpoint;
begin
getcursorpos(d);
if  p.Top<2 then
begin
if not(((d.X>p.Left) and (d.X<p.Right) and (d.Y>p.Top) and (d.y<p.Bottom)))then
begin
movewindow(self.Handle,p.Left,0-(p.Bottom-p.Top)+2,p.Right-p.Left,p.Bottom-p.Top+2,true);
form1.
timer1.Enabled:=false;
timer3.Enabled:=true;
end;
end;
end;

procedure TForm1.Timer2Timer(Sender: TObject);
begin
GetWindowRect(self.Handle,p);
end;

procedure TForm1.Timer3Timer(Sender: TObject);
var
d:tpoint;
begin
getcursorpos(d);
if ((d.X>p.Left) and (d.X<p.Right) and (d.Y>p.Top) and (d.y<p.Bottom)) then
begin
movewindow(self.Handle,p.left,-2,p.Right-p.Left,p.Bottom-p.Top,true);
SetActiveWindow(self.Handle);
timer1.Enabled:=true;
timer3.Enabled:=false;
end;
end;

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
if p.Top<-2 then
movewindow(self.Handle,p.left,-2,p.Right-p.Left,p.Bottom-p.Top,true);
end;

end.




窗体文件内容:
object Form1: TForm1
  Left = 801
  Top = 87
  Width = 193
  Height = 505
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  OnMouseMove = FormMouseMove
  PixelsPerInch = 96
  TextHeight = 13
  object Timer1: TTimer
    Interval = 400
    OnTimer = Timer1Timer
    Left = 24
    Top = 48
  end
  object Timer2: TTimer
    Interval = 150
    OnTimer = Timer2Timer
    Left = 80
    Top = 56
  end
  object Timer3: TTimer
    Interval = 400
    OnTimer = Timer3Timer
    Left = 32
    Top = 120
  end
end

posted on 2009-02-01 01:03 小叶子 阅读(253) 评论(0)  编辑 收藏 引用 所属分类: 笔记
只有注册用户登录后才能发表评论。

笔记和文章,可能抄袭,只为学习,请原谅