Gracias
Neftali.
Me funcionó de diez el ejemplo de tu página.
Lo unico que hice fue agregarle el mensaje al formulario principal, y que se acomoden las posiciones del segundo. Por si a alguien le interesa, quedaría algo asi:
Código Delphi
[-]
unit uMain;
...
private
procedure WMWindowPosChanging(var Message: TWMWindowPosChanging); message WM_WINDOWPOSCHANGING;
...
implementation
...
procedure TfMain.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
const
SC_DRAGMOVE = $F012;
begin
ReleaseCapture;
Perform(WM_SYSCOMMAND, SC_DRAGMOVE, Integer(PointToSmallPoint(Point(X,Y))));
end;
procedure TfMain.WMWindowPosChanging(var Message: TWMWindowPosChanging);
begin
inherited;
if (Assigned(form2)) and (form2.Visible) then
form2.acomodarVentana;
end;
...
Y en el segundo formulario:
Código Delphi
[-]
unit unit2;
...
public
procedure acomodarVentana;
...
implementation
...
procedure TForm2.acomodarVentana;
begin
Self.Top := fMain.Top;
Self.Left := fMain.Left - Self.Width;
end;
...
Si al moverlo se ve el efecto del parpadeo en el formulario, simplemente agregar al evento OnCreate del form2:
Código Delphi
[-]
Self.DoubleBuffered := true;
En fin. Gracias
Neftali por tu ayuda. Me ha venido muy bien, ya que no sabía como seguir. Hasta llegue a pensar que simplemente no se podia hacer esto
. Y gracias tambien a todos los que se tomaron el trabajo de intentar entenderme!!
Saludos.