Hello,
I have the following code called on WM_MOVE
procedure TForm15.WMMove(var Message: TMessage);
begin
if( (((TWMMove(Message).XPos + Self.Width >= Form14.Left) and (TWMMove(Message).XPos <= Form14.Left)) or
((TWMMove(Message).XPos <= Form14.Left + Form14.Width) and (TWMMove(Message).XPos >= Form14.Left))) and
(((TWMMove(Message).YPos + Self.Height >= Form14.Top) and (TWMMove(Message).YPos <= Form14.Top)) or
((TWMMove(Message).YPos <= Form14.Top + Form14.Height) and (TWMMove(Message).YPos >= Form14.Top))))
then begin
Self.DragKind := dkDock;
end else Self.DragKind := dkDrag;
end;
It's probably the ugliest if statement you've seen in your life,but that's not the question. :)
It's supposed to change DragKind if the current form(Self) is somewhere inside the mainForm(Form14).
However,When It sets DragKind to dkDock ,it doesn't make the currentForm(Self) dockable unless the user stops moving the form and start moving it again,so I'm trying to do the following:
If the result from the statement above is non zero and dkDock is set then Send the following messages to the form:
WM_EXITSIZEMOVE //stop moving the form
WM_ENTERSIZEMOVE //start movement again
However,I don't know how to do it:
SendMessage(Self.Handle,WM_EXITSIZEMOVE,?,?);
I tried using random parameters(1,1) ,but no effect.Maybe that's not the right way?