如何移动标主窗体题栏,子窗体随着移动 我试过移动窗体能做到效果,但移动标题栏就不行。。请帮帮忙,十万火急 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 根据主窗体的位置,让子窗体自己判断移动MoveWindow(...,true);你看看是不是这个函数,我还是没有理解你的意思 unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;type TForm1 = class(TForm) private { Private declarations } procedure WMWindowPosChanged(var Msg: TWMWindowPosChanged);message WM_WINDOWPOSCHANGED; public { Public declarations } end;var Form1: TForm1;const uFlag = SWP_NOACTIVATE or SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE;implementationuses Unit2;{$R *.dfm}{ TForm1 }procedure TForm1.WMWindowPosChanged(var Msg: TWMWindowPosChanged);var Rect: TRect; X, Y, Cx, Cy: Integer; uFlag2: UINT;begin inherited; if Form2 <> nil then //如果子窗体存在 begin GetWindowRect(Form2.Handle, Rect); //获得子窗体的位置 with Msg do begin X := WindowPos^.x + WindowPos^.cx; //新X坐标 Y := WindowPos^.y; //新Y坐标 Cx := WindowPos^.cx; //新宽度 Cy := WindowPos^.cy; //新高度 end; uFlag2 := uFlag; //移动必要时 if (Rect.Top <> Y) or (Rect.Left <> X) then uFlag2 := uFlag2 and (not SWP_NOMOVE); if (Rect.Bottom - Rect.Top <> Cy) or //尺寸变更必要时 (Rect.Right - Rect.Left <> Cx) then uFlag2 := uFlag2 and (not SWP_NOSIZE); if uFlag <> uFlag2 then //都必要时 SetWindowPos(Form2.Handle, 0, X, Y, Cx, Cy, uFlag2); end;end;end. 请问大家用什么制作 帮助文件啊 要支持中文的 能告诉我哪里有下载吗??? 谁知道FoxMail的那个工具栏是用什么控件做的? 打开窗口的小问题! 求MDI子窗口与Tab对应的方法 如何在程序中自动注册SQL Server的ODBC? 图像显示问题 谁知道<<Delphi 6应用开发指南>>电子版下载的地方 高薪是如何赚到的??--请关注(调查高薪者情况 directX和vfw有啥关系? 挑战思路,如何虚拟出一个特定MAC地址 有用TAPI 3.0做过呼叫中心的程序吗,有话请给个例子 如和安装delphi
MoveWindow(...,true);
你看看是不是这个函数,我还是没有理解你的意思
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;type
TForm1 = class(TForm)
private
{ Private declarations }
procedure WMWindowPosChanged(var Msg: TWMWindowPosChanged);message WM_WINDOWPOSCHANGED; public
{ Public declarations }
end;var
Form1: TForm1;const uFlag = SWP_NOACTIVATE or SWP_NOZORDER or SWP_NOMOVE or SWP_NOSIZE;implementationuses Unit2;{$R *.dfm}{ TForm1 }procedure TForm1.WMWindowPosChanged(var Msg: TWMWindowPosChanged);
var
Rect: TRect;
X, Y, Cx, Cy: Integer;
uFlag2: UINT;
begin
inherited;
if Form2 <> nil then //如果子窗体存在
begin
GetWindowRect(Form2.Handle, Rect); //获得子窗体的位置
with Msg do
begin
X := WindowPos^.x + WindowPos^.cx; //新X坐标
Y := WindowPos^.y; //新Y坐标
Cx := WindowPos^.cx; //新宽度
Cy := WindowPos^.cy; //新高度
end;
uFlag2 := uFlag; //移动必要时
if (Rect.Top <> Y) or (Rect.Left <> X) then
uFlag2 := uFlag2 and (not SWP_NOMOVE);
if (Rect.Bottom - Rect.Top <> Cy) or //尺寸变更必要时
(Rect.Right - Rect.Left <> Cx) then
uFlag2 := uFlag2 and (not SWP_NOSIZE);
if uFlag <> uFlag2 then //都必要时
SetWindowPos(Form2.Handle, 0, X, Y, Cx, Cy, uFlag2);
end;
end;
end.