Вниз
Скачать: CL | DM;

приклеить дополнительную форму   Найти похожие ветки 

← →
tst   (2006-09-26 14:40) [0]

Мужики, подскажите что перехватываем для отлова перемещения окна главной формы, что бы можно было бы спозиционировать рядышком где-нибудь дополнительную формочку?


← →
Игорь Шевченко ©   (2006-09-26 14:50) [1]

WM_MOVE


← →
tst   (2006-09-26 15:12) [2]

спасибо Игорёк!

Примерно так:

type
 TfrmMain = class(TForm)
 private
   procedure OnMove(var Msg: TWMMove); message WM_MOVE;
end;

...

procedure TfrmMain.OnMove(var Msg: TWMMove);
begin
 inherited;
 ...
end;

...


← →
Игорь Шевченко ©   (2006-09-26 15:54) [3]


> Примерно так:


unit main;

interface

uses
 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
 StdCtrls;

type
 TfMain = class(TForm)
   cbSyncMoving: TCheckBox;
 private
   procedure WMMove (var Message: TWmMove);
     message WM_MOVE;
   procedure WMMoving (var Message: TMessage);
     message WM_MOVING;
   procedure UpdateChildPos;
   procedure UpdateChildRect (const Rect: TRect);
 end;

var
 fMain: TfMain;

implementation
uses
 Child;

{$R *.DFM}

{ TfMain }

procedure TfMain.UpdateChildPos;
begin
 if Assigned(fChild) then begin
   fChild.Left := Left;
   fChild.Top := Top + Height;
 end;
end;

procedure TfMain.UpdateChildRect(const Rect: TRect);
begin
 if Assigned(fChild) then begin
   fChild.Left := Rect.Left;
   fChild.Top := Rect.Top + Height;
 end;
end;

procedure TfMain.WMMove(var Message: TWmMove);
begin
 inherited;
 UpdateChildPos;
end;

procedure TfMain.WMMoving(var Message: TMessage);
begin
 inherited;
 if cbSyncMoving.Checked then
   UpdateChildRect (PRect(Message.LParam)^);
end;

end.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.026 c
1-1166197623
Max_2006
2006-12-15 18:47
2007.02.11
Окно серым цветом


15-1169407250
Chuk & Gek
2007-01-21 22:20
2007.02.11
Вопрос к тем, кто разбирается


4-1159288235
Tanya
2006-09-26 20:30
2007.02.11
Программа с невидимым окном для приема сообщений


2-1169543020
vigo_
2007-01-23 12:03
2007.02.11
Печать по-русски


3-1163714813
dreamse
2006-11-17 01:06
2007.02.11
Помогите составить SQL запрос




   Наверх