我把WM_MOVE和WM_SIZE放在ApplicationEvent控件里,结果什么都没发生。给WM_MOVE设断点,移动程序窗体的时候就没跳进去。WM_SIZE也是,倒是程序创建的时候WM_SIZE有两次操作,这是为什么啊
procedure TMainfrm.ApplicationEventsMessage(var Msg: tagMSG;
var Handled: Boolean);
begin
case Msg.message of
WM_MOVE: Panel8.Invalidate;
WM_SIZE: Panel8.Invalidate;
end;
end;
procedure TMainfrm.ApplicationEventsMessage(var Msg: tagMSG;
var Handled: Boolean);
begin
case Msg.message of
WM_MOVE: Panel8.Invalidate;
WM_SIZE: Panel8.Invalidate;
end;
end;
private
{ Private declarations }
procedure WndProc(var Msg: TMessage); override;
public
{ Public declarations }
end;var
Form1: TForm1;
i: integer = 1;
implementation{$R *.dfm}procedure TForm1.WndProc(var Msg: TMessage);
begin
if Msg.Msg = WM_Size then
begin
Caption := 'WMSize' + IntToStr(i);
Inc(i);
end
else if Msg.Msg = WM_Move then
begin
Caption := 'WMMove' + IntToStr(i);
Inc(i);
end;
inherited;
end;
inherited;
这句的作用是什么?