using System.Runtime.InteropServices; public static class Win32API { [DllImport("User32.dll")] public static extern short GetAsyncKeyState(int vKey); }