当前位置: 首页 > 图文教程 > 开发语言 > Delphi > 不可移动的窗口示例代码

Delphi
Delphi设计简易对象垃圾回收框架
Delphi开发Web应用程序打印组件
Delphi客户服务器应用开发(四)
Delphi自定义部件开发(一)
Delphi自定义部件开发(二)
Delphi自定义部件开发(三)
Delphi自定义部件开发(四)
开发Delphi对象式数据管理功能(一)
开发Delphi对象式数据管理功能(二)
开发Delphi对象式数据管理功能(三)
开发Delphi对象式数据管理功能(四)
开发Delphi对象式数据管理功能(五)
用Delphi语言来学设计模式之简单工厂篇
Delphi2005和DUnit搭建敏捷开发平台记录
你想成Delphi高手吗?快来学Delphi快捷键
Borland最新版开发工具Delphi2005抢先预览
用Delphi实现JPEG格式图像的显示
用DELPHI编程访问SQL SERVER数据库
用Delphi编制趣味动画鼠标
用Delphi实现选单的自动隐藏功能

Delphi 中的 不可移动的窗口示例代码


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-30   浏览: 74 ::
收藏到网摘: n/a

 
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;
           &