Moving the mouse with code
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Moving the mouse with code

  1. #1
    Join Date
    Jul 2009
    Posts
    6

    Moving the mouse with code

    I am currently starting to attempt to make a program that can move my cursor to certain colors on my monitor. The problem is this seems like it will be 10x harder than I first thought. Is there anyone that can point me in the right direction to get started?

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,300

    Re: Moving the mouse with code

    Quote Originally Posted by Shadoninja View Post
    ... Is there anyone that can point me in the right direction to get started?
    Probably...
    But why don't you describe your problem a bit more better? What does "move my cursor to certain colors on my monitor" mean?
    What type of application are you going to use?
    ...
    Victor Nijegorodov

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    5,931

    Re: Moving the mouse with code

    See the sample for moving mouse cursor programmatically.

    SetCursorPos function
    Attached Files Attached Files
    Best regards,
    Igor

  4. #4
    Join Date
    Apr 2013
    Posts
    34

    Re: Moving the mouse with code

    and to add to Igor's response,

    if all you want to do is look at a specific pixel, and if it's colour "A" then move the cursor to that x,y point, and if colour = "B" then don't move the cursor. then all you need is the "GetPixelColor(x,y)" but if you wanna find any colour on the screen that matches your colour, then it'll be much much more difficult. (well you COULD also do that with "GetPixelColor" but it'd be extremely slow.)

  5. #5
    Join Date
    Apr 2013
    Posts
    34

    Re: Moving the mouse with code

    .. no edit function on these forums?.. anyways.
    http://www.vintasoft.com/docs/vsimag...ixelColor.html

    that is the breif explanation of getpixelcolor, and you can use igor's reply to figure out how to do the mouse thing.

    cheers ^.^

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center