Exemplo n.º 1
0
        /// <summary>
        /// send a string
        /// </summary>
        public static void InputStr()
        {
            //NativeMethods.SendMessage(myIntPtr, NativeContansts.WM_CHAR, BitConverter.ToInt32(ch, 0), 0);
            NativeStructs.INPUT input = new NativeStructs.INPUT();
            input.type = 1; //keyboard_input
            input.ki.wVk = VirtualKeyCodes.VK_T;
            input.ki.dwFlags = 0;
            NativeMethods.SendInput(1, ref input, Marshal.SizeOf(input));

            NativeStructs.INPUT input1 = new NativeStructs.INPUT();
            input1.type = 1; //keyboard_input
            input1.ki.wVk = VirtualKeyCodes.VK_T;
            input1.ki.dwFlags = 2;
            NativeMethods.SendInput(1, ref input1, Marshal.SizeOf(input1));
        }
Exemplo n.º 2
0
        /// <summary>
        /// send a string
        /// </summary>
        public static void InputStr()
        {
            //NativeMethods.SendMessage(myIntPtr, NativeContansts.WM_CHAR, BitConverter.ToInt32(ch, 0), 0);
            NativeStructs.INPUT input = new NativeStructs.INPUT();
            input.type       = 1; //keyboard_input
            input.ki.wVk     = VirtualKeyCodes.VK_T;
            input.ki.dwFlags = 0;
            NativeMethods.SendInput(1, ref input, Marshal.SizeOf(input));

            NativeStructs.INPUT input1 = new NativeStructs.INPUT();
            input1.type       = 1; //keyboard_input
            input1.ki.wVk     = VirtualKeyCodes.VK_T;
            input1.ki.dwFlags = 2;
            NativeMethods.SendInput(1, ref input1, Marshal.SizeOf(input1));
        }
 public static extern uint SendInput(uint nInput, ref NativeStructs.INPUT pInput, int cbSize);