title: Screen scraping an application window and interacting with the mouse and keyboard
body: <p>The other day I found myself addicted to a Flash game and frustrated by the thing at the same time.  In a moment of frustration with the game I thought I would make a 'bot' to beat it for me.  Well, I really wouldn't, but it made me realize: I don't know how to interact with another application in a way to do this.  Which brings me to the question, <strong>how would one take screenshots of another running application and interact with it with the keyboard and mouse</strong>.  Ideally the solution would be in a managed language like c#.</p>
  
  <p>When doing the background reading the net was drowning with articles on scraping HTML.  There were not many articles on actually screen scraping an application.  </p>
  
  <p>Diverse answers are appreciated as I’m really looking at surveying what’s out there.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I'm looking for a way to interface with another application rather than script/macro another application.  </p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Could something like Xming be used to redirect the interface?  <a href="http://www.straightrunning.com/XmingNotes/" rel="nofollow noreferrer">http://www.straightrunning.com/XmingNotes/</a></p>
  
  <p>Perhaps a Terminal Services client?
  <a href="http://www.codeproject.com/KB/cs/RemoteDesktop_CSharpNET.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/cs/RemoteDesktop_CSharpNET.aspx</a></p>