Button mouse over and leave events

I use Code::Blocks to create C++ softwares.
I created a button:

button = CreateWindow(
TEXT("BUTTON"),
TEXT(szov),
WS_VISIBLE | WS_CHILD,
10, 10,
100, 25,
hWnd,
(HMENU) 1,
NULL, NULL);

I use WM_COMMAND to check when button clicked, but I'd like to create mouse over and mouse leave events too.

Can anyone help me?
You need to handle WM_MOUSEHOVER and WM_MOUSELEAVE
And if you want those events pertaining to the button specifically, as opposed to the main top level Form/Window/Dialog, then you likely need to subclass the button control to get access to its Window Procedure, which is different from your top level Form's Window Procedure.
Registered users can post here. Sign in or register to post.