Exemplo n.º 1
0
 private bool OnGetMinMaxInfo(ref Message m)
 {
     PI.MINMAXINFO minmax = PI.MINMAXINFO.GetFrom(m.LParam);
     if (!MaximumSize.IsEmpty)
     {
         minmax.ptMaxTrackSize = new PI.POINT(MaximumSize.Width, MaximumSize.Height);
     }
     minmax.ptMinTrackSize = new PI.POINT(MinimumSize.Width, MinimumSize.Height);
     Marshal.StructureToPtr(minmax, m.LParam, false);
     return(true);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Occurs when the MinMaxInfo needs to be retrieved by the operating system.
        /// </summary>
        /// <param name="m">
        /// The window message.
        /// </param>
        /// <returns>
        /// true if the message was handled; otherwise false.
        /// </returns>
        private bool OnGetMinMaxInfo(ref Message m)
        {
            PI.MINMAXINFO minMax = (PI.MINMAXINFO)Marshal.PtrToStructure(m.LParam, typeof(PI.MINMAXINFO));
            if (!MaximumSize.IsEmpty)
            {
                minMax.ptMaxTrackSize.X = MaximumSize.Width;
                minMax.ptMaxTrackSize.Y = MaximumSize.Height;
            }

            minMax.ptMinTrackSize.X = MinimumSize.Width;
            minMax.ptMinTrackSize.Y = MinimumSize.Height;
            Marshal.StructureToPtr(minMax, m.LParam, false);
            return(true);
        }