截取FORM1的移动消息
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
procedure WMMove(var msg: TMessage);Message WM_Move;
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.WMMove(var msg: TMessage);
begin
if Assigned(form2) then
begin
with Form2do
begin
Left := Self.Left + Self.Width;
Top := Self.Top;
end;
end;
inherited;
end;