Thanks Scott and foobar.
I have it up and running now. It helped me to write the OnMouseMove in my
ToolBar Class.
enlarged bitmap of the button at the tip of mouse cursor.
If you have any code nipped to do that, I will be a happy man.
Where is your OnMouseMove handler? If it is in your button class then
as I understand, it should get executed
when mouse enters the button region.
To get mouse leave event you would need to handle WM_MOUSELEAVE
message
ON_MESSAGE(WM_MOUSELEAVE, OnMouseLeave)
WM_MOUSELEAVE message won't be generated by default. We need to track
mouse event for TME_LEAVE so that it gets generated.
OnMouseMove handler can include code similar to following lines to let
button receive MouseLeave event
if (!m_bMouseTracking)
{
TRACKMOUSEEVENT mouseevent;
mouseevent.cbSize = sizeof(TRACKMOUSEEVENT);
mouseevent.dwFlags = TME_LEAVE;
mouseevent.hwndTrack = this->m_hWnd;
if (::_TrackMouseEvent(&mouseevent))
{
m_bMouseTracking = TRUE;
}
}
and inside OnMouseLeave method handler we set m_bMouseTracking back to
FALSE so that next time mouse enters we
again start tracking mouse event for its leave message.
HTH
On May 7, 4:30 pm, Laurs <La...@discussions.microsoft.com> wrote:
I allready handle the TTN_NEEDTEXT events, but how do I know when the mouse
is in the region of the button. I have a virtual OnMouseMove(UINT nFlags,
CPoint pnt) but I get no message when the mouse is in a toolbar.
--
Laurs Laursen