WMSysCommand canceling move



I am having to capture the WMSysCommands and it is apparently
capturing the ability to move the form by the title bar. Does anyone
know the way to get the move to work again? Thanks.

procedure TForm1.WMSysCommand;
begin

if (Msg.CmdType = SC_MOVE) then <---- something like this?
...

if Msg.CmdType = SC_CLOSE then //close doesn't work
without this
Close;

if (Msg.CmdType = SC_MINIMIZE) or // - button (upper
right of form next to X button)
(Msg.CmdType = SC_MAXIMIZE) or // single pane button
(Msg.CmdType = SC_RESTORE) then begin // double pane button
if EncartaButton5.Caption = 'Start' then begin
Mouse.CursorPos := (Point( (Screen.DesktopWidth div 2) -
25,
(Screen.DesktopHeight div 2) +
35));
case MessageDlg('Monitoring suspended. Start monitoring?',
mtConfirmation, [mbYes, mbNo], 0) of
mrYes : begin
RxTrayIcon1.Icon :=
RxTrayIcon1.Icons.Icons[0];
Button5Click(nil);
end;

mrNo : RxTrayIcon1.Icon :=
RxTrayIcon1.Icons.Icons[2];
end;
end;

Form1.Hide;
end;

//// DefaultHandler(Msg); //take this out to stop min/max/stop
action
end;
.


Quantcast