I noticed that the message WM_NCHitTest isn’t sent to a form when the cursor is inside the caption bar (not on the border).
I tried to intercept it using either
procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST;
or
procedure WndProc(var Message: TMessage); override;
According to MSDN I was expecting to receive it for any point, with no blind spots.
Did I miss something or this is the intended behaviour?
I’m using Delphi 2010 on Windows 7, with Aero on.
Yes — that’s expected. Unless you disable the DWM, you won’t get WM_NCHITTEST messages when the cursor is in the title bar. Basically, when the DWM is on, the title bar “belongs” to the DWM, not your application.
If you really need those messages, you can disable the DWM — but keep in mind that when/if you do this, it does not just disable it for your application. If you disable it, it’s disabled for the whole system (until it’s re-enabled again, of course).