Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Runtime.InteropServices;
- using System.Threading.Tasks;
- namespace SGEP.Helpers.NativeMethods.NativeWinApiInterops
- {
- class KeyboardEmulate
- {
- [DllImport("user32.dll", SetLastError = true)]
- private static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, int dwExtraInfo);
- public static void SendCtrlhotKey(char key)
- {
- keybd_event(0xA2, 0, 0, 0);
- keybd_event((byte)key, 0, 0, 0);
- keybd_event((byte)key, 0, 0x2, 0);
- keybd_event(0xA2, 0, 0x2, 0);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement