Reputation: 2440
In Delphi 5 this used to work. I have a component that descends from TCustomControl and I implement the cmmouseleave message:
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
Now if I am just moving the mouse over the control the message is triggered but if I am moving the mouse while keeping the mouse left button down, the same message is not triggered. AFAIK I have not called the begindrag method and the dragmode is set to manual. Any clue of what could be going on?
Upvotes: 3
Views: 502
Reputation: 54822
The mouse is captured when you press the left button. Hence the control will receive mouse move messages (WM_MOUSEMOVE
) even if the mouse is outside the control. It will receive mouse leave message when the button is released. This should also be the case with D5.
You can exclude csCaptureMouse
from ControlStyle
if you don't want the mouse to be captured in response to a WM_LBUTTONDOWN
.
Upvotes: 6