3 Replies - 3077 Views - Last Post: 03 October 2009 - 06:45 AM Rate Topic: -----

#1 Iamazn  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 44
  • Joined: 17-June 09

Move mouse to Color?

Posted 13 September 2009 - 04:44 PM

How would I make a program that would move a mouse to a certain color? I DO NOT want to limit it to the form. (i.e. Whole screen)
I have no idea how to do this so I dont have any code. If someone could give me some references, I could prob post some code
Is This A Good Question/Topic? 1

Replies To: Move mouse to Color?

#2 Unorthodox  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 39
  • Joined: 02-October 09

Re: Move mouse to Color?

Posted 03 October 2009 - 12:08 AM

Could you elaborate?

Do you mean that you want to move the cursor to a particular colored control in your application??
Was This Post Helpful? 0
  • +
  • -

#3 crepitus  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 85
  • View blog
  • Posts: 383
  • Joined: 08-September 09

Re: Move mouse to Color?

Posted 03 October 2009 - 03:20 AM

In your earlier post I replied with a link to an example which finds a colour on the screen and clicks it.
Try the second code sample posted by JohnWein, the long one:
http://social.msdn.m...2f-ce98599adaf2


(These questions are usually game cheats, sometimes they are to automate a program for accessibility.

The .Net app is running minimized. It regularly scans the entire screen content looking for a pixel of a particular colour. If it finds it, it moves the mouse there and clicks it.)
Was This Post Helpful? 0
  • +
  • -

#4 Aurel300  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 230
  • Joined: 10-November 07

Re: Move mouse to Color?

Posted 03 October 2009 - 06:45 AM

No, this is really easy.
First of all you will need the ScreenShot library, I think I saw it on CodeProject (or? dunno - search for ScreenShot vb.net or something).
Then you will have to use the screenshot library to produce a picture of the whole screen...
YouŽll then go pixel by pixel through that image...
And when you find a pixel of that color stop the cycling and use Cursor.Position to set its new position.
If you also want to click... I donŽt remember that ^^
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1