myamanda

博客园 首页 新随笔 联系 订阅 管理
捕捉 Windows WM_WINDOWPOSCHANGING信息和 WindowPos 结构的‘or’标记,它把预先定义了的常数SWP_NOMOVE 和 SWP_NOSIZE 作为信息的lparam参数。


type
TForm1 = class(TForm)
private
procedure WMPosChange(var Message: TWMWINDOWPOSCHANGING);
message WM_WINDOWPOSCHANGING;
public
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure Tform1.WMPosChange(var Message: TWMWINDOWPOSCHANGING);
begin
PWindowPos(TMessage(Message).lParam).Flags :=
PWindowPos(TMessage(Message).lParam).Flags or
SWP_NOMOVE or SWP_NOSIZE;
end;
posted on 2009-07-15 11:17  myamanda  阅读(173)  评论(0编辑  收藏  举报