Recent

Author Topic: Detect that mouse cursor is over the title bar  (Read 3702 times)

CM630

  • Hero Member
  • *****
  • Posts: 1076
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Detect that mouse cursor is over the title bar
« on: August 05, 2021, 09:52:07 am »
How am I to detect that the mouse cursor is over the title bar of the form?
The OnMouseMove event is not triggered when the mouse is over the title bar.
So I thought I could detect OnMouseMove for the entire OS, but I have found a Windows-only solution.
In the worst case, I can place a timer that will check the position of the mouse let say every 150 ms, but probably that is not the best way.
Лазар 3,0 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

CM630

  • Hero Member
  • *****
  • Posts: 1076
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Detect that mouse cursor is over the title bar
« Reply #1 on: August 23, 2021, 02:02:08 pm »
Thanks.
1. It did not compile at first until I added types in the uses section.

2. Procedure Tform1.WMNCMouseMove(var msg:TLmessage); fires when the mouse cursor is over the title bar or over the borders of the form.
3. Procedure TForm1.WMMouseMove(Var msg:TLmessage); fires when I am somewhere else on the form.

So it is still not exactly what I need. I will read some more...
Лазар 3,0 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

 

TinyPortal © 2005-2018