sendinput() simulate a ctr+v

Hey guys, I'm trying to simulate a ctrl+v execution.
But it doesn't work and I am not quite sure where to go from here.

Also I do wonder if SendInput(1, ip, sizeof(INPUT));
the number "1" is the count of how the size of the array of the structs? (so it should be 4?. However it don't work no matter what I try and some clarification would be thankful!


INPUT ip[4];
ip[0].type = INPUT_KEYBOARD;
ip[0].ki.wScan = 0;
ip[0].ki.dwFlags = 0;
ip[0].ki.wVk = VK_CONTROL;
ip[0].ki.time = 0;
ip[0].ki.dwExtraInfo = 0;

ip[1].type = INPUT_KEYBOARD;
ip[1].ki.wScan = 0;
ip[1].ki.dwFlags = 0;
ip[1].ki.wVk = 0x56;
ip[1].ki.time = 0;
ip[1].ki.dwExtraInfo = 0;

ip[2].type = INPUT_KEYBOARD;
ip[2].ki.wScan = 0;
ip[2].ki.dwFlags = KEYEVENTF_KEYUP;
ip[2].ki.wVk = VK_CONTROL;
ip[2].ki.time = 0;
ip[2].ki.dwExtraInfo = 0;

ip[3].type = INPUT_KEYBOARD;
ip[3].ki.wScan = 0;
ip[3].ki.dwFlags = KEYEVENTF_KEYUP;
ip[3].ki.wVk = 0x56;
ip[3].ki.time = 0;
ip[3].ki.dwExtraInfo = 0;

SendInput((sizeof(ip)/sizeof(INPUT)), ip, sizeof(INPUT));
Last edited on
closed account (E0p9LyTq)
Have you looked at the documentation for SendInput()?

https://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx
Edited my post. I have looked at it, and this works apart from that it doesn't really paste the password into the "steam client" program that I want it to paste to. But it works to paste to a textdocument. I dont really understand why, because the active windows is indeed "Steam".
Topic archived. No new replies allowed.