namespace GMLC01HerramientasCAD.Comun.Presentacion
{
    using System;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    using System.Drawing;

    /// <summary>
    /// 
    /// </summary>
    internal static class NativeMethods
    {
        ///// <summary>
        ///// 
        ///// </summary>
        ///// <param name="lpClassName"></param>
        ///// <param name="lpWindowName"></param>
        ///// <returns></returns>
        //[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
        //public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

        ///// <summary>
        ///// 
        ///// </summary>
        ///// <param name="hWndChild"></param>
        ///// <param name="hWndNewParent"></param>
        ///// <returns></returns>
        //[DllImport("user32.dll", SetLastError = true)]
        //public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);

        ///// <summary>
        ///// 
        ///// </summary>
        ///// <param name="hWnd"></param>
        ///// <param name="hWndInsertAfter"></param>
        ///// <param name="X"></param>
        ///// <param name="Y"></param>
        ///// <param name="cx"></param>
        ///// <param name="cy"></param>
        ///// <param name="uFlags"></param>
        ///// <returns></returns>
        //[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
        //public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlgs);

        //const uint SWP_NOSIZE = 0x1;
        //const uint SWP_NOMOVE = 0x2;
        //const uint SWP_SHOWWINDOW = 0x40;
        //const uint SWP_NOACTIVATE = 0x10;

        ///// <summary>
        ///// 
        ///// </summary>
        //public static readonly IntPtr HWNDTOPMOST = new IntPtr(-1);
        ///// <summary>
        ///// 
        ///// </summary>
        //public static readonly IntPtr HWNDNOTOPMOST = new IntPtr(-2);
        /// <summary>
        /// 
        /// </summary>
        //public static readonly IntPtr HWNDTOP = new IntPtr(0);
        ///// <summary>
        ///// 
        ///// </summary>
        //public static readonly IntPtr HWNDBOTTOM = new IntPtr(1); 

        ///// <summary>
        ///// 
        ///// </summary>
        ///// <param name="hForm"></param>
        ///// <param name="hInsertAfter"></param>
        //public static void ZOrder(IntPtr hForm, IntPtr hInsertAfter)
        //{
        //    SetWindowPos(hForm, hInsertAfter,
        //                0, 0, 0, 0,
        //                SWP_NOMOVE | SWP_NOSIZE |
        //                SWP_SHOWWINDOW | SWP_NOACTIVATE);
        //}

        //// Reallocates an array with a new size, and copies the contents
        //// of the old array to the new array.
        //// Arguments:
        ////   oldArray  the old array, to be reallocated.
        ////   newSize   the new array size.
        //// Returns     A new array with the same contents.
        ///// <summary>
        ///// 
        ///// </summary>
        ///// <param name="oldArray"></param>
        ///// <param name="newSize"></param>
        ///// <returns></returns>
        //public static System.Array ResizeArray(System.Array oldArray, int newSize)
        //{
        //    int oldSize = oldArray.Length;
        //    System.Type elementType = oldArray.GetType().GetElementType();
        //    System.Array newArray = System.Array.CreateInstance(elementType, newSize);
        //    int preserveLength = System.Math.Min(oldSize, newSize);
        //    if (preserveLength > 0)
        //        System.Array.Copy(oldArray, newArray, preserveLength);
        //    return newArray;
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        ///// <param name="font"></param>
        ///// <param name="fontSize"></param>
        ///// <returns></returns>
        //static public Font ChangeFontSize(Font font, float fontSize)
        //{
        //    if (font != null)
        //    {
        //        float currentSize = font.Size;
        //        if (currentSize != fontSize)
        //        {
        //            font = new Font(font.Name, fontSize,
        //                font.Style, font.Unit,
        //                font.GdiCharSet, font.GdiVerticalFont);
        //        }
        //    }
        //    return font;
        //}
    }
}