<kilik3000@gmail.com> wrote in message
news:1178723133.427119.104690@q75g2000hsh.googlegr oups.com...
The message doesn't go from Windows to the form to the button; if goes
directly from Windows to the button without ever stopping at the form.
A typical message loop in your Win32 program looks something like this:
while ( GetMessage( &msg ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
The call to GetMessage() gets the topmost message in the application's
message queue. It's the Windows OS that creates queues for each different
application, and puts the messages (like your WM_MOUSEMOVE message) into the
queue for the correct application. Inside the message there's a field which
holds the handle of the window to which the message is directed. The
DispatchMessage() function looks at that field, and then sends the message
directly to the window procedure (WndProc(), another function that you write
for your application) for the destination window. Inside the WndProc(), the
appearance of the button will be changed to the highlight effect.
You can read about message handling at "Messages and Message Queues " at
http://msdn2.microsoft.com/en-us/library/ms632590.aspx
Mike