using System.Runtime.InteropServices; namespace DigitalSystem { public class FuncionesExternas { [StructLayout(LayoutKind.Sequential)] public struct RECT { public int Left; public int Top; public int Right; public int Bottom; } public const int VK_CONTROL = 0x11; public const byte VK_TAB = 0x09; public const byte VK_RETURN = 0x0D; public const int KEYEVENTF_KEYDOWN = 0x0000; public const int KEYEVENTF_KEYUP = 0x0002; public const uint MOUSEEVENTF_MOVE = 0x0001; public const uint MOUSEEVENTF_LEFTDOWN = 0x0002; public const uint MOUSEEVENTF_LEFTUP = 0x0004; public const uint MOUSEEVENTF_RIGHTDOWN = 0x0008; public const uint MOUSEEVENTF_RIGHTUP = 0x0010; public const uint MOUSEEVENTF_ABSOLUTE = 0x8000; public const byte VK_SHIFT = 0x10; public const int VK_CAPITAL = 0x14; [DllImport("user32.dll")] public static extern bool keybd_event(byte bVK, byte bScan, uint dwFlags, uint dwExtraInfo); [DllImport("user32.dll")] public static extern short VkKeyScan(char ch); [DllImport("user32.dll")] public static extern IntPtr GetForegroundWindow(); [DllImport("user32.dll")] public static extern IntPtr GetWindowRect(IntPtr hwnd,out RECT lprect ); [DllImport("user32.dll")] public static extern IntPtr BringWindowToTop(IntPtr hwnd); [DllImport("user32.dll")] public static extern IntPtr SetForegroundWindow(IntPtr hwnd); [DllImport("user32.dll")] public static extern IntPtr SetCursorPos(int xpos, int ypos); [DllImport("user32.dll")] public static extern void mouse_event(uint dwFlags,int dx,int dy,uint dwData,UIntPtr dwExtraInfo); [DllImport("user32.dll")] public static extern short GetKeyState(int nVirtKey); } }