I've been messing around building a small Rust library for moving the cursor to a destination point for MacOS, Windows and Linux. While looking into how to move the cursor in Windows I wanted to know what the difference between SendInput()and SetCursorPos() is.
Something to note, I'm looking at this from the purely from perspective of the cursor movement. I appreciate that SendInput() itself has a significantly wider level of functionality to it (keyboard etc).
Back in the day I would usually use SetCursorPos() to automate movement which would do the job well albeit it would be a little choppy in its movement (likely a skill issue).
Looking at the MSDN documentation I can see they come from the same DLL; User32.dll.
I created a small program in C++ that uses both of the functions we are discussing and opened the compiled binary into x64dbg to start tracking where these functions take us by putting a breakpoint on each function.
When looking at SendInput() in the debugger, it calls NtUserSendInput() which makes a syscall to jump into kernel mode with the RAX register of 0x107A.