private void WmNCCalcSize(ref Message m)
{
if (m.WParam == HeaderPanelNativeMethods.FALSE)
{
HeaderPanelNativeMethods.RECT ncRect = (HeaderPanelNativeMethods.RECT)m.GetLParam(typeof(HeaderPanelNativeMethods.RECT));
Rectangle proposed = ncRect.Rect;
RecalcNonClientArea(ref proposed);
ncRect = HeaderPanelNativeMethods.RECT.FromRectangle(proposed);
Marshal.StructureToPtr(ncRect, m.LParam, false);
}
else if (m.WParam == HeaderPanelNativeMethods.TRUE)
{
HeaderPanelNativeMethods.NCCALCSIZE_PARAMS ncParams =
(HeaderPanelNativeMethods.NCCALCSIZE_PARAMS)m.GetLParam(typeof(HeaderPanelNativeMethods.NCCALCSIZE_PARAMS));
Rectangle proposed = ncParams.rectProposed.Rect;
RecalcNonClientArea(ref proposed);
ncParams.rectProposed = HeaderPanelNativeMethods.RECT.FromRectangle(proposed);
Marshal.StructureToPtr(ncParams, m.LParam, false);
}
m.Result = IntPtr.Zero;
}