I don't know how many times I need to send the same link here but let's say that
this is the last time:
this is a post about wpf but in the middle there is a paragraph about how win32k in
windows processes mouse messages:
http://blogs.msdn.com/b/dwayneneed/archive/2008/09/08/transparent-windows-i…
And here is the important part:
Which HWND is the mouse over?
The operating system must respond very quickly to mouse movement. Windows uses a
dedicated Raw Input Thread (RIT), running in the kernel, to handle the signals from the
mouse hardware. The RIT quickly scans over the HWND hierarchy to see which window the
mouse is over. Because the system must be responsive, no application code is invoked.
For normal windows, the RIT checks the mouse position against the window's rectangle
(or region, if one is set). But for layered windows, the RIT looks in the bitmap that
specifies the content for the window and checks the effective transparency at that
location (which can be affected by the constant opacity setting, the color key setting, or
the per-pixel alpha channel). If the pixel is 100% transparent, the RIT skips the window
and keeps looking. Once a window has been located, the mouse move flag is set on the
thread that owns the window. This will cause the thread to receive a WM_MOUSEMOVE message
the next time it calls GetMessage() and there are no other higher-priority messages.
Now let me explain why a flag is needed. The window manager needs to coalesce mouse move
messages. If the mouse moves over a window and the system registers 10 positions over it,
if the window doesn't process messages fast enough the unprocessed positions are
dropped and only the last is kept. Even if another message gets between these mouse move
messages get lost.
That's why the last mouse position is not stored in a message queue but in a field in
the thread info. That's how the window manager worked the last 20 years in windows.
I'm sick and tired to see readable and correct code to be rewritten by shitty code,
that is not readable and has obvious bugs without any reason why the previous
implementation was wrong. I just give up. Do whatever you like with this shitty project of
yours. I don't care anymore.