SendMessage with Linux lazarus / 32-Linux ---------------------------------------------------------------------- Iniw · 2021-07-21 14:01 Hello, with lazarus-2.0.12-fpc-3.2.0-win64, I can move a Form by clicking on its background [and on its TControl] Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if Msg = LM_MOUSEMOVE then    begin      ReleaseCapture();      SendMessage(Self.Handle, LM_NCLButtonDown, HTCaption, 0);    end;The same code in Linux has no effect [even if no compilation error appears]. Is SenMessage inoperative on Linux or am I doing it wrong ? Best regards. IW ---------------------------------------------------------------------- MarkMLl · 2021-07-21 16:20 The documentation suggests to me that it's not intended to work on any OS other than Windows: are you absolutely certain that those message numbers are portable? MarkMLl ---------------------------------------------------------------------- Iniw · 2021-07-21 16:36 Hello, i suspected it doesn't work with linux or mac os.  But I had not found the documentation specifying it.. So I'll use the classic onMouseDown and co in a less elegant way. Best regards. IW ---------------------------------------------------------------------- howardpc · 2021-07-21 17:07 I think on Linux the LM_NCLMouseButtonDown message is not interpreted  by window managers in the same way as on Windows. For cross-platform use you have to do some variation on this sort of thing: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.ApplicationProperties1UserInput(Sender: TObject; Msg: cardinal);var  pt: TPoint;begin  case Msg of    LM_LBUTTONDOWN: begin                      if not bPotentiallyMoving then                      bPotentiallyMoving := True;                      Cursor := crDrag;                    end;    LM_LBUTTONUP: begin                    bPotentiallyMoving := False;                    Cursor := crDefault;                end;    LM_MOUSEMOVE: if bPotentiallyMoving then                  begin                      pt := ScreenToClient(Mouse.CursorPos);                      Left := ClientOrigin.X + pt.X;                      Top := ClientOrigin.Y + pt.Y;                    end;  end;end; ---------------------------------------------------------------------- MarkMLl · 2021-07-21 17:41 Quote from: IniWo on July 21, 2021, 06:36:42 pmHello, i suspected it doesn't work with linux or mac os.  But I had not found the documentation specifying it.. So I'll use the classic onMouseDown and co in a less elegant way. Best regards. IW Out of curiosity: you've said it doesn't work but is that code successfully executed (i.e. if you put a debugger on that SendMessage())? The documentation is phrased as though it's intended to be used if you're recompiling something which works on Delphi on the same platform. I am by no means an LCL expert, and responded primarily to make sure your question remained visible in the "Recent" list... grepping the sources it looks as though LM_NCLBUTTONDOWN is defined but literally never used. OTOH LM_MOUSEMOVE appears in the code for all the widget sets. MarkMLl