Пример #1
0
        public static void SendShiftKeyUp(IntPtr windowHandle)
        {
            var virtualKey   = VK_SHIFT;
            var scanCode     = GetScanCode(virtualKey);
            var keyParameter = new KeyParameter(1, scanCode, false, false, true, true);

            NativeMethods.PostMessage(windowHandle, (uint)KeyboardCommand.KeyUp, new UIntPtr(virtualKey), keyParameter.ToLParam());
        }
Пример #2
0
        public static void SendKeyDown(IntPtr windowHandle, byte virtualKey)
        {
            var scanCode = GetScanCode(virtualKey);
              var keyParameter = new KeyParameter(1, scanCode, false, false, false, false);

              NativeMethods.PostMessage(windowHandle, (uint)KeyboardCommand.KeyDown, new UIntPtr(virtualKey), keyParameter.ToLParam());
        }
Пример #3
0
        public static void SendKeyDown(IntPtr windowHandle, byte virtualKey)
        {
            var scanCode     = GetScanCode(virtualKey);
            var keyParameter = new KeyParameter(1, scanCode, false, false, false, false);

            NativeMethods.PostMessage(windowHandle, (uint)KeyboardCommand.KeyDown, new UIntPtr(virtualKey), keyParameter.ToLParam());
        }
Пример #4
0
        public static void SendShiftKeyUp(IntPtr windowHandle)
        {
            var virtualKey = VK_SHIFT;
              var scanCode = GetScanCode(virtualKey);
              var keyParameter = new KeyParameter(1, scanCode, false, false, true, true);

              NativeMethods.PostMessage(windowHandle, (uint)KeyboardCommand.KeyUp, new UIntPtr(virtualKey), keyParameter.ToLParam());
        }