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

Delphi
利用Delphi编写Socket通信程序
用Delphi设计“抢三十”游戏
对《QQ列表精灵》源代码分析和仿制
Delphi接口编程的两大陷阱
基于Delphi的组件设计之简单实例
基于Delphi的组件设计之概念
浅述Delphi下的OpenGL图形开发
深入理解Delphi的消息机制
Delphi处理SQL Server多媒体数据
Delphi中为RichEdit加入链接
用Delphi7设计FTP上传软件
利用Delphi编程控制摄像头
用Delphi实现快闪窗体信息提示
Delphi制作图形化的ComboBox
用Delphi设计能携带附件的EMail
Delphi中利用网页打造程序界面
Delphi控件的“拿来主义”
Delphi设计PhotoShop型弹出菜单
用Delphi获取Windows及系统路径
Delphi控制Excel自动生成报表

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


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