·天新网首页·加入收藏·设为首页
首页|笔记本|手机|数码相机|摄像机|MP3/MP4|主板|内存|显示器|办公|打印机|下载|开发|汽车|学院|业界
硬件|台式机|数码|数字家庭|投影仪|GPS/CPU|显卡|硬盘|服务器|网络|一体机|驱动|源码|游戏|考试|报价
不可移动的窗口示例代码
http://dev.21tx.com 2004年03月31日 delphi精髓网 delphi精髓

           unit Unit1;
            interface
            uses


              Windows  Messages  SysUtils  Classes  Graphics  Controls  Forms 
            Dialogs
              StdCtrls;
            type
              TForm1 = class(TForm)
                Label1: TLabel;
                Label2: TLabel;
                Label3: TLabel;
                Label4: TLabel;
                Label5: TLabel;
                procedure FormCreate(Sender: TObject);
              private
                { Private declarations }
                OldLeft OldTop OldWidth OldHeight: Integer;
              public
                { Public declarations }
              protected
                procedure WMMOVING(var msg: TMessage);message WM_MOVING;
              end;
            var
              Form1: TForm1;
            implementation
            {$R *.DFM}
            procedure TForm1.WMMOVING(var msg: TMessage);
            var
              rect: ^TRect;
            begin
              label1.Caption := IntToStr(msg.WParam);
              rect := Pointer(msg.LParam);
              Label2.Caption := IntToStr(rect.Left);
              Label3.Caption := IntToStr(rect.Top);
              Label4.Caption := IntToStr(rect.Right);
              Label5.Caption := IntToStr(rect.Bottom);
              rect.Left := OldLeft;
              rect.Top := OldTop;
              rect.Right := rect.Left + OldWidth;
              rect.Bottom := rect.Top + OldHeight;
             
              msg.Result := 0;
            end;
            procedure TForm1.FormCreate(Sender: TObject);
            begin
              OldLeft := Left;
              OldTop := Top;
              OldWidth := Width;
              OldHeight := Height;
            end;
            end.,

上一篇: Delphi“流”实现文件加密器
下一篇: Delphi实现窗体控件自由摆布

Google
 
热点文章
关于我们 | 联系我们 | 广告服务 | 工作机会 | 版权声明 | 欢迎投稿 | 网站地图
Copyright © 2000-2008 , www.21tx.com , All Rights Reserved .
© 晨新科技 版权所有 Created by TXSite.net