using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace Begin
{
    
    public class WinApi
    { 
        
        
        [DllImport("user32.dll")] 
        [return: MarshalAs(UnmanagedType.Bool)] 
        public static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk); 
 
        [DllImport("user32.dll")] 
        [return: MarshalAs(UnmanagedType.Bool)] 
        public static extern bool UnregisterHotKey(IntPtr hWnd, int id);

        [DllImport("user32.dll")]
        public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
        
        [DllImport("user32.dll")]
        public static extern int SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);

        [DllImport("user32.dll")]
        public static extern int SetWindowPos(IntPtr hwnd,int ord,int x,int y,int dx,int dy,int uflag);

      //  [DllImport("user32.dll")]
        //public static extern int ShowWindow(IntPtr hwnd, int ord, int x, int y, int dx, int dy, int uflag); 
　　//参数1为要顶层显示的窗口句柄，参数2指定显示的层次，参数7为附加选项，其余参数指定窗口位置和大小，均可忽略。在窗口的Open或Activate事件中加入如下函数调用： 
        [DllImport("user32.dll", EntryPoint = "ShowWindow")]
        public static extern int ShowWindow(IntPtr hwnd,int nCmdShow);


        [DllImport("user32.dll", EntryPoint = "GetClassName")]
        public static extern int GetClassName(int hwnd, StringBuilder lpClassName, int nMaxCount);
        [DllImport("user32.dll", EntryPoint = "EnumWindows")]
        public static extern int EnumWindows(CallBack x, int y); 

    }   
}
