Is there an event fired when moving a form ? lazarus / 21-General ---------------------------------------------------------------------- petevick · 2022-04-12 15:34 I know OnChangeBounds is fired when moving a form, but I'm looking for an event that is fired after OnChangeBounds has finished, something like OnMouseUp, but OnMouseUp is not fired when the mouse is on the form caption area. ---------------------------------------------------------------------- Sieben · 2022-04-12 16:04 Did you try TApplicationProperties.OnUserInput with a check like 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_LBUTTONNUP) then  begin    //...  end; ---------------------------------------------------------------------- petevick · 2022-04-12 16:12 Quote from: Sieben on April 12, 2022, 06:04:16 pmDid you try TApplicationProperties.OnUserInput with a check like 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_LBUTTONNUP) then  begin    //...  end;Hi Sieben, thanks for the reply. I didn't try that, mainly because I was not aware of it. Might that work in both Linux and Windows ? ---------------------------------------------------------------------- petevick · 2022-04-12 16:38 Quote from: Sieben on April 12, 2022, 06:04:16 pmDid you try TApplicationProperties.OnUserInput with a check like 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_LBUTTONNUP) then  begin    //...  end;Sieben, what unit is required for LM_LBUTTONNUP to be recognised ?? ---------------------------------------------------------------------- petevick · 2022-04-12 16:51 After a bit of experimenting, I'm pretty sure that TApplicationProperties.OnUserInput, like OnMouseUp, does not fire when the mouse is on the caption area. ---------------------------------------------------------------------- Sieben · 2022-04-12 17:07 It's unit LMessages. But I'm afraid you're right, unfortunately it doesn't fire as well. ---------------------------------------------------------------------- balazsszekely · 2022-04-12 18:35 So easy on windows, under linux I don't think there is a straight forward way, you may try to detect the mouse down event with a timer set to 100 ms: 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 uses LCLIntf, LCLType; procedure TForm1.Timer1Timer(Sender: TObject);var  R: TRect;  H: Integer;begin  GetWindowRect(Self.Handle, R);  H :=  GetSystemMetrics(SM_CYCAPTION);  if H > 0 then  begin    R.Top := R.Top - H;    R.Height := H;  end;  if (GetKeyState(VK_LBUTTON) < 0) and (PtInRect(R, Mouse.CursorPos)) then    Caption := 'mouse down on form caption'  else    Caption := 'drag the form';end; ---------------------------------------------------------------------- petevick · 2022-04-12 18:43 Quote from: GetMem on April 12, 2022, 08:35:40 pmSo easy on windows, under linux I don't think there is a straight forward way, you may try to detect the mouse down event with a timer set to 100 ms: "easy on windows" now there's two words in the same sentence you don't see very often, easy and windows ---------------------------------------------------------------------- jamie · 2022-04-12 21:48 I guess if the LCL supported "LM_EXITSIZEMOVE" this wouldn't be such a problem. ---------------------------------------------------------------------- balazsszekely · 2022-04-13 05:37 @petevick Quoteeasy on windows" now there's two words in the same sentence you don't see very often, easy and windows  Yes it's easy. I can tap into WM_EXITSIZEMOVE message, write a low level mouse hook, etc.