Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than user32, prefix the name with the module name and a period.
SendInput (user32)
.
The SendInput function synthesizes keystrokes, mouse motions, and button clicks to the currently active window
Private Declare Function SendInput Lib "user32.dll" (ByVal cInputs As Integer, ByRef pInputs As INPUT, ByVal cbSize As Integer) As Integer
C# User-Defined Types:
Notes:
Nope.
Tips & Tricks:
Please add some!
Sample Code:
var pInputs = new[]
{
new StructLib.INPUT()
{
type = EnumLib.INPUT_TYPE.INPUT_KEYBOARD,
ki = new StructLib.KEYBDINPUT()
{
wScan = EnumLib.ScanCodeShort.KEY_S,
wVk = EnumLib.VirtualKeyShort.KEY_S
}
},
new StructLib.INPUT()
{
type = EnumLib.INPUT_TYPE.INPUT_KEYBOARD,
ki = new StructLib.KEYBDINPUT()
{
wScan = EnumLib.ScanCodeShort.KEY_S,
wVk = EnumLib.VirtualKeyShort.KEY_S,
dwFlags = EnumLib.KEYEVENTF.KEYUP
}
},
new StructLib.INPUT()
{
type = EnumLib.INPUT_TYPE.INPUT_KEYBOARD,
ki = new StructLib.KEYBDINPUT()
{
wScan = EnumLib.ScanCodeShort.KEY_S,
wVk = EnumLib.VirtualKeyShort.KEY_S
}
},
new StructLib.INPUT()
{
type = EnumLib.INPUT_TYPE.INPUT_KEYBOARD,
ki = new StructLib.KEYBDINPUT()
{
wScan = EnumLib.ScanCodeShort.KEY_S,
wVk = EnumLib.VirtualKeyShort.KEY_S,
dwFlags = EnumLib.KEYEVENTF.KEYUP
}
},
new StructLib.INPUT()
{
type = EnumLib.INPUT_TYPE.INPUT_KEYBOARD,
ki = new StructLib.KEYBDINPUT()
{
wScan = EnumLib.ScanCodeShort.KEY_S,
wVk = EnumLib.VirtualKeyShort.KEY_S
}
},
new StructLib.INPUT()
{
type = EnumLib.INPUT_TYPE.INPUT_KEYBOARD,
ki = new StructLib.KEYBDINPUT()
{
wScan = EnumLib.ScanCodeShort.KEY_S,
wVk = EnumLib.VirtualKeyShort.KEY_S,
dwFlags = EnumLib.KEYEVENTF.KEYUP
}
}
};
var hWindow = Api.user32.FindWindow("notepad", null);
Api.user32.SetForegroundWindow(hWindow);
Thread.Sleep(2500);
Api.user32.SendInput(
(uint)pInputs.Length, pInputs, StructLib.INPUT.Size);
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).