How to get the aero snap state of a window?

  aero-snap, winapi, windows

When a window is resized by aero snap, User32.GetWindowPlacement(hWnd).rcNormalPosition still stores its original rectangle, while User32.GetWindowRect is affected.
Since aero snap seems independent from WINDOWPLACEMENT, now we cannot collect the complete information of the actual placement simply using user32.dll. Thus I’m wondering if there’s a way to get the aero snap state of a window, indicating whether the window is docked and which side the window is docked to.

Source: Windows Questions