Results 1 to 3 of 3

Thread: Major Help

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2007
    Posts
    1

    Major Help

    Hello everyone, Basically i need the source code in Visual Basic for a
    20 x 20 = 40 pixil sqaure area around the mouse to check for the following colours:

    Colour 1:

    red: 0xF40404
    yellow: 0xE87824
    Orange: 0xE87824

    Colour 2:

    teal: 0x209070
    blue: 0x083498
    white: 0xCCE0D0


    As soon as any of those colours are found; the letter "A" keystroke is sent followed by a "Left" mouse click. And this is to be looped forever.. Would be great if you can get this toggle on the 2 different sides (Colour 1 and Colour 2) based on Hotkeys.

    I'm asking for a lot but hopefully there are other out there who are looking for something like this as well; Thanks in advance if anyone can help. Also if anybody likes here's my version of it in AutoIT, but just to let you know it's SUPER slow, that's why i'm requesting it in VB
    http://img201.imageshack.us/img201/1...lcolourdi3.jpg

  2. #2
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: Major Help

    Where are you checking the colour with the mouse, on a specific control, on a complete form (with all its controls) or even outside your application?
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  3. #3
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    Re: Major Help

    Look up GetPixel() for getting the colour of the pixel.
    -> Go to Start->Microsoft Visual Studio 6.0->Microsoft Visual Studio tools-> API viewer
    Note: you may need to load a text file called win32API.txt

    If GetPixel is not fast enough try GetDIBits
    -> http://www.codeguru.com/vb/gen/vb_graphics/gdi/article.php/c2381/

    VB prefers if you specify your colours like &HF40404 rather than 0xF40404.

    Look up SetKeyboardState() as well, that allows you to force keystrokes.
    -> http://www.mvps.org/access/api/api0046.htm

    Quote Originally Posted by user751139
    I'm asking for a lot but hopefully there are other out there who are looking for something like this as well; Thanks in advance if anyone can help. Also if anybody likes here's my version of it in AutoIT, but just to let you know it's SUPER slow, that's why i'm requesting it in VB
    If you want some serious speed go further down to C++ or C.....
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

Posting Permissions

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



Click Here to Expand Forum to Full Width