Dan's comments make perfect sense. Unfortunately the keystrokes approach doesn't work either, no doubt for the same reason. It looks like that's the just the way things are with RDP.
Main Topics
Browse All TopicsI've written a program (C++/MFC) that automates certain mouse and keyboard operations. It works perfectly on all systems I've tested against and when running on a machine accessed via remote desktop - UNTIL the remote desktop window is closed or minimized. At that point the actions submitted via SendInput just seem to be ignored by the OS. I've also seen comments from other developers that things like GetCursorPos also fail in the same situation.
Can anybody fill me in on why this is happening, and hopefully suggest a possible workaround?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: DanRollinsPosted on 2009-10-27 at 20:31:18ID: 25679761
I would expect that behavior. Remote access systems ar designed to avoid unnecessary network traffic. Just as an image is "clipped" when it is covered by another window, I would assume that actions are "clipped" as well when they cannot apply to the target program.
You could test the theory: Resize or move the target window until a control, such as an OK button, is no longer visible. I would expect that SendInput of a mouse click would no longer be able to cause that button to be clicked.
The workaround might be to send keystrokes rather than mouse clicks. In almost every Windows application, there is a keystroke method to invoke every command.
As to minimized windows... Programs often behave differently when minimized. For instance, here is no reason to paint complex graphics if the window is just a taskbar icon.