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

Delphi
Action 造成cpu占用过多的奇怪问题
教你如何用Delphi生成GBK码表
Delphi7的WebService与数据库
Delphi实用代码:自绘XP风格菜单
用AdoDataSet实现数据表的导入导出
和md5.asp结果一样的Delphi加密代码
用Delphi制作中国式报表
将12345678.99转换成12,345,678.99
用Delphi编程时如何利用线程
资源文件在DELPHI中的使用
属性和控件编辑器
Delphi中TApplication类的巧用
具有不同字体的列表框
Delphi中易混淆的概念
在Delphi中巧改窗体文件实现控件数组化
Delphi 中自做动态显示的控件
利用Delphi编程发送E-mail
Delphi中怎样监视POP3信箱
DELPHI和注册表
Delphi参考手册

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-30   浏览: 79 ::
收藏到网摘: 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;
           &