2

I want to create a windows app. I want the user to be able to click a button on the app. Once the button is clicked I want the user to draw a square somewhere on the screen... anywhere. The square will probably be drawn over another application window, so that window needs to ignore any clicking that is happening over it. Once the square has been drawn I want to grab the coordinates of where it was drawn and the size of it. Then i want to continuously check to see if the image being displayed behind this virtual square changes. If it changes I want to force a mouse click in the center of it. I think I can do the mouse click with mouse_event() in user32.dll.

However, I have not a freaking clue how to do the rest =D

Any direction would be awesome...

All I am looking for here are links to libraries and/or API's. I do not know where to start looking and I am fully capable of reading documentation.

bradj
  • 890
  • 5
  • 11
  • 1
    would java be an option or are you locked into .NET? You can do things like this with the Java Robot API http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/Robot.html – PeskyGnat Mar 23 '12 at 22:09
  • I am not locked on .NET. A friend just linked this http://cropper.codeplex.com/. I could use the drawing and bitmap generation from this tool then compare bmp data between polls. – bradj Mar 23 '12 at 22:16

1 Answers1

1

Using Java, Zoom uses createScreenCapture() to render an enlarged 16 x 16 pixel BufferedImage taken as the mouse is dragged across the screen. Once you have the BufferedImage, you can periodically recapture the screen at the same point and use the getRGB() method to compare. See also Using Timers in Swing Applications.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045