I am working on a program that will replicate, and then extend the functionality of Aero Snap.
Aero Snap restores a maximized window, if the user "grabs" it's title bar, and I am having difficulties identifying this action.
Given a cursor position in screen coordinates, how would I check if the position is within the window's title bar? I am not really at home in the Win32 API, and could not find a way that works reliably for complicated scenarios such as:

Note that tabs that chrome inserts into the title bar. Office does something similar with the quick launch menu.
WM_NCHITTESTmay be what you're looking for. - Captain ObvliousDwmExtendFrameIntoClientAreafunction. This really complicates things, since this effectively makes part of the window that is rendered as part of the Non-Client area actually belong to the client area. In these instances, you simply cannot tell where the title-bar ends and the client area begins. See: msdn.microsoft.com/en-us/library/windows/desktop/… I reckon, your best bet might be to explicitly send WM_NCHITTEST messages to the application. Since it should return HTCAPTION (provided it also self-handles WM_NCHITTEST) - enhzflep