tags:

views:

57

answers:

1

Hi i have three controls (CButtton) in my application,whenever mouse move over a control,i want to capture when mouse enters on which control in a window and when it leaves and i have to change the caption of a button control.

Thanks in Advance

+3  A: 

There is no windows message/event that indicates 'mouse enter' or 'mouse leave'. However this can be achieved by handling the 'MouseMove' message for your control and capturing the mouse input to check if the point is inside the control area. Release the capture if the point is out of the control area.

for sample code check here.

Hemant
You can also take a look at the TrackMouseEvent API function: http://msdn.microsoft.com/en-us/library/ms646265(VS.85).aspx
humbagumba