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

Delphi
回调函数与Delphi的事件模型
Delphi中如何实现透明按钮
用Delphi编写打印程序的窍门
自己制作网页特效软件
Delphi+Cell全攻略
开发基于DCOM的局域网聊天室(一)
用简单的Tracer类来为应用写入跟踪
快捷方式/删除项/EXE自删除DIY
排序Select中Option项的一个示例
QQ聊天记录器演示程序(二)
QQ聊天记录器演示程序(一)
Delphi单元文件详解
Delphi学习:在Listbox加背景图
Delphi7目录结构----初学者参考
Delphi学习:在流中查找任意字串
制作一个IPhunter
播放自定义的声音
利用Dephi5编写控制面板程序
用Delphi编写Win2000服务程序
Spcomm串口控件的例程

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


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