I have an application which injects keystrokes into applications via SendKeys.
Unfortunately, the application will not work when I am running it via Remote Desktop because of the well known issue that SendKeys doesn't work with Remote Desktop.
Has anyone solved this issue before, or have any good suggestions on how to resolve it?
In this case, pressing WIN + CTRL + left/right keys would always switch desktops on the local computer, and there'd be some alternative hotkey to switch virtual desktops on the remote computer, such as WIN + CTRL + ALT + left/right.
While you are seeing the Remote Desktop window, simultaneously press the “CTRL,” “ALT,” and “END” keys on your keyboard. Instead of executing the standard CTRL-ALT-DEL command on your local computer, this command runs the command on the remote machine.
Alt+Home—Pressing the Alt+Home keyboard combination with Remote Desktop displays the Start menu on the remote system. The Start menu gives you quick access to the different programs installed on the remote system. This key combination is the same as pressing the Windows key on your local desktop. 7.
Unfortunately, the answer to this question is NO. Remote Desktop, as a Windows built-in feature, allows people to remotely access a PC from another PC, which provides a large amount of convenience for many users. With Remote Desktop, we can not only realize file transfer by using copy and paste, but not drag and drop.
SendKeys is not a good fit mainly due to:
Better alternatives:
SendMessage
or SendInput
for simple needsSample code using SendMessage
:
HWND hwndNotepad = FindWindow(_T("Notepad"), NULL); HWND hwndEdit = FindWindowEx(hwndNotepad, NULL, _T("Edit"), NULL); SendMessage(hwndEdit, WM_SETTEXT, NULL, (LPARAM)_T("hello"));
In my case I was successfully using WinAPI's SendInput with hardware scan codes. It seems like SendKeys maps chars to scan codes incorrectly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With