1

I want to use the SendInput function (winuser.h) to simulate huge amounts of inputs. I have no idea tho what the maximum input array length is.

I checked the docs, but I can't find anything there:
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendinput

5
  • 2
    The first parameter is a UINT so, theoretically, that sets the max. But I would just check the return value, which tells you how many were sent. Do that in a loop till all are sent. Commented May 17 at 20:26
  • The function requires you to pass a parameter of type UINT which specifies the number of inputs. The maximum value that a UINT can represent is 4,294,967,295. However, the keyboard and mouse input streams probably have some kind of limit, so it is probably unlikely that you will be able to insert that many events. These limits may be different in different versions of the operating system. For this reason, you should rely only on the return value of the function SendInput in order to determine how many events were successfully inserted. Commented May 17 at 20:50
  • 1
    This is a really weird requirement, what purpose lies behind it? Commented May 17 at 21:37
  • As per the docs, “This function is subject to UIPI” — one of the consequences being that that number of inputs may be circumscribed. The actual limitations are dependent on factors not under your control. The actual question you should be asking is how to verify that your program is correctly affecting the target process? Commented May 18 at 1:35
  • @Dúthomhas Yeah that's a good question. But the function always returns the correct amount of inputs even if inputs are lost. Commented May 18 at 16:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.