Synthesizes keystrokes, mouse motions, and button clicks.
Questions tagged [sendinput]
251 questions
5
votes
4 answers
C# InputSimulator wrapper - how to use it?
I want to simulate keyboard click for a external program.I've tried SendMessage, PostMessage, SendKeys but they do not send the key to one specific program. So i wanted to try SendInput and i have downloaded a good wrapper for SendInput -…

TreantBG
- 1,192
- 6
- 25
- 44
5
votes
2 answers
Why does SendInput Ctrl+V not work in Outlook?
I have a program that uses system wide hotkeys Ctrl+Shift+a key of the user's choice to paste the text in the clipboard by sending the Ctrl+V combination using SendInput as used here. This works fine in most programs. But in Outlook on the To field…

user3640611
- 87
- 2
- 10
5
votes
1 answer
C# DirectInput SendInput Doesn't affect to game
I need some help about DirectInput, I'll tell what i am trying to do. I want to do my program sends key combinations to a game when i press only one key. Examp.: I'll press "r" and it will pres "1","3","2","4" keys. I found some codes from here. But…

eyups
- 711
- 7
- 12
5
votes
1 answer
SendInput not working for hold key C++
I have this bit of code which uses SendInput to send a key press but it doesn't work for when I want to long hold a key (eg long hold 'a' would return 'aaaaaaaaa' in notepad).
Now I have looked all over google and the only way I can see to get…

Ollie
- 473
- 3
- 7
- 19
5
votes
1 answer
Simulate click into a hidden window
I've got a C# problem,
I am able to simulate a click to the current window, but I would like to do it if the window is minimized or hidden.
Any ideas?

tlovidiu
- 53
- 1
- 3
4
votes
2 answers
How to send a string to other application including Microsoft Word
I was trying to accomplish this but did not get good results. I used GetForegroundWindow(), AttachThreadInput(uint,uint,bool) and GetFocus() functions to send the strings to another window. It works with Notepad, Wordpad and other applications, but…

Francerz
- 43
- 1
- 1
- 4
4
votes
2 answers
Send key "MediaPlayPause" to an application without setting focus to it
I am creating a program that will send media key inputs (such as MediaPlayPause, MediaNextTrack, etc) to an application that I have the IntPtr of. Sort of like a virtual remote control.
So after researching I found this, which almost tells me…

godly-devotion
- 177
- 3
- 15
4
votes
1 answer
How Do I Use SendInput in Delphi?
I was using the Mouse_Event Function in Delphi 2009, but the Delphi documentation says this function has been superceded and to use SendInput instead.
The Delphi SendInput documentation defines the syntax and parameters, but there are no examples…

lkessler
- 19,819
- 36
- 132
- 203
4
votes
1 answer
c++ - SendInput() doesn't manage Alt codes properly
On a program that I'm developing I have to simulate keystrokes, and to do so I use the SendInput() method, passing as argument a vector containing the inputs which are part of the keystroke. My current code seems to work properly with all the…

DiHase
- 43
- 5
4
votes
2 answers
SendInput on c++ doesn't take Ctrl and Shift in account
I'm trying to send a CTRL+SHIFT+END key stroke to a control, in a C++ application written with Embarcadero. I'm using the code below:
tagINPUT ip;
ip.type = INPUT_KEYBOARD;
ip.ki.wScan = 0;
ip.ki.time = 0;
ip.ki.dwExtraInfo = 0;
// Appui sur…

C. MARIN
- 95
- 9
4
votes
3 answers
SendInput - (mouse movement simulation)
I've been trying to simulate a series of inputs into a process.
The only one I was unsuccessful in achieving is mouse movement.
I have found the closest bet online:
bool mouse_move(int x, int y)
{
INPUT input;
input.type = INPUT_MOUSE;
…

illogical204
- 41
- 1
- 1
- 2
4
votes
1 answer
WH_MOUSE_LL Hook doesn't get called for injected events (mouse_event, SendInput)
My code uses a WH_MOUSE_LL hook to initially suppress all mouse input, unless the dwExtraInfo property is set to a certain value. The program is also registered for raw input for mouse devices, so that I can identify which device is responsible for…

foven
- 163
- 1
- 5
4
votes
1 answer
How to simulate specified keyboard keystroke in c++?
I have US standard keyboard but I would like to simulate the italian or chinese type of keystrokes by using SendInput method.
I use SendInput metode like this,
KEYBDINPUT kb = { 0 } ;
ZeroMemory ( & kb , sizeof ( KEYBDINPUT ) ) ;
ZeroMemory ( &…

bala
- 275
- 2
- 3
- 13
4
votes
2 answers
SendInput vs. keybd_event
MSDN states that keybd_event has been superceded by SendInput. During a rewrite I switched to using SendInput...which was fine except when trying to send an Alt-key combination. On a Win7 64-bit system (haven't tried elsewhere yet), send an Alt-key…

Mark Wilsdorf
- 751
- 1
- 5
- 18
4
votes
1 answer
Autohotkey wrong keystrokes sent to console
I am trying to understand this bug and I am looking for a workaroud.
Using this script:
#NoEnv
#SingleInstance force
SendMode Input
;Alt+t to send keystrokes
!t::Send, /[]
It send the correct keystrokes /[] to all windows but the windows console…

niroyb
- 114
- 6