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

Delphi
Delphi客户服务器应用开发(三)
Delphi快速入门(五)
Delphi面向对象的编程方法(一)
Delphi面向对象的编程方法(二)
Delphi面向对象的编程方法(三)
Delphi面向对象的编程方法(四)
字符串列表及应用(一)
字符串列表及应用(二)
文本编辑器的设计(一)
文本编辑器的设计(二)
Delphi图形图像编程(一)
Delphi的两个实用技巧(1)
Delphi的两个实用技巧(2)
delphi实例编程之--制作可随处拖放的工具栏
Delphi快速入门(一)
Delphi快速入门(二)
Delphi快速入门(三)
Delphi快速入门(四)
动态链接库编程(二)
Delphi图形图像编程(二)

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


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