OpenDialog and mouse event lazarus / 31-LCL ---------------------------------------------------------------------- hedgehog · 2025-06-16 07:43 I noticed strange behavior of OpenDialog (Lazarus 4 and Win64) 1) Call OpenDialog. 2) Place the file selection window above the form. 3) Select the file by double-clicking After that MouseMove event will occur for form, and Shift = [ssLeft] Is this normal behavior? ---------------------------------------------------------------------- ASerge · 2025-06-17 16:22 Quote from: hedgehog on June 16, 2025, 09:43:17 amIs this normal behavior? Not confirm. Windows 7, x64, Lazarus 4.0, fpc 3.2.2. After double- clicking on the file above the form, no mouse event occurred. ---------------------------------------------------------------------- Martin_fr · 2025-06-17 17:37 Win 10 => yes, get the mouse-move. Not sure, if that is right or wrong. The dialog closes on the 2nd mouse down. I.e. you can do (on a filename in the open dlg) - left mouse down - left mouse up - left mouse down (and keep down) And the dialog will close. Now you have - the button down - the dlg closed - the mouse over the form Since the dlg no longer exists, any mouse-capture that it might have had, would be gone. So mouse event go - as they normally do - to the control below the mouse. Well, and yes, there is a mouse move. Even if the mouse did not move since (and during) the button up/downs. But the last mouse pos for the form was over the button, and now it is no longer over the button. That apparently is reported as a move. (and catching it in the debugger, it appears that it was generated by the OS / by Windows) If I position the form such as, - that the file open dialog will open above it, - and that one of the filenames will be over the area of the form And I position the mouse cursor where that filename will be... And then - I lift the mouse off the table, so there will be no movement - I trigger the dialog open via keyboard (so the mouse can be kept were it is) - I double click the filename (that will have appeared below the mouse)   and optionally keep the button down on the 2nd click... => then there is no move being reported. But of course, if I keep the button down, and start moving the mouse, then there will be. ---------------------------------------------------------------------- hedgehog · 2025-06-19 06:06 I forgot to say that I have Windows 10. My application uses mouse control. And when using OpenDialog I noticed some incorrect behavior. I think OpenDialog should not pass mouse events ---------------------------------------------------------------------- jcmontherock · 2025-06-19 09:37 It's work fine in Windows 11