using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
namespace Helper
{
    /// <summary>
    /// Win32部分api的封装
    /// </summary>
    [ComVisible(true)]
    public static class Win32Helper
    {
        [DllImport("user32.dll")]
        public static extern bool ReleaseCapture();
        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
        /// <summary>
        /// 移动窗体
        /// </summary>
        /// <param name="f">窗体</param>
        public static void MoveWindow(IWin32Window f)
        {
            ReleaseCapture();
            SendMessage(f.Handle, 274, 61458, 0);
        }
        [DllImport("kernel32.dll")]
        public static extern bool FreeConsole();
        [DllImport("kernel32.dll")]
        public static extern bool AllocConsole();
    }
}
