Skip to content

A WinAPI-based console application for detecting specific pixel colors on your screen and automating interactions.

License

Notifications You must be signed in to change notification settings

H-D-OWL/ColorSearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ColorSearch

Releases License

Description

A console application that uses WinAPI to determine specific colors of pixels on the screen and perform certain actions (moving the cursor to the found color, emulating pressing a specific key, and a combination of these actions).

Demo

ColorSearchGame2

ColorSearchGame1

Table of Contents

Technologies used

  • WinAPI;

  • GDI;

  • System hooks;

  • Bitwise image analysis;

  • Input emulation;

Requirements

  • OS: Windows 10 / 11
  • IDE / Build tools: Visual Studio 2022 (or newer) with the Desktop development with C++ workload installed
    • Alternatively, msbuild available via Developer Command Prompt for VS 2022
  • Permissions: The program uses low-level hooks and input emulation. On some systems, you may need to run it as administrator.

Compilation

Visual Studio

  1. Open ColorSearch.sln in Visual Studio.

  2. Set Configuration to Release and Platform to x64 (or x86 depending on your Windows architecture).

Sprite-0001
  1. Go to Build → Build Solution or press Ctrl + Shift + B.
изображение
  1. The executable will be located in the build output folder: ColorSearch\x64\Release\ColorSearch.exe (x64) or ColorSearch\Release\ColorSearch.exe (x86).

Command prompt

  1. Open Developer Command Prompt for VS 2022

  2. Navigate to the project directory: cd path\to\ColorSearch. For example: cd C:\Users\User2\Desktop\ColorSearch

  3. Enter the command in the terminal: msbuild ColorSearch.sln /p:Configuration=Release /p:Platform=x64 (or /p:Platform=x86 depending on your Windows architecture)

  4. The executable will be located in the build output folder: ColorSearch\x64\Release\ColorSearch.exe (x64) or ColorSearch\Release\ColorSearch.exe (x86).

Usage

  1. Define the scanning area (Set two points between which there will be a rectangular scanning area):
  • To set a point, move the cursor to the desired location and press F1. The points should not be on the same line (horizontal or vertical).
Sprite-0003
  1. Define colors to search:
  • To set a color, hover over it and press F2. You must define at least 1 color.
  • To finish defining a color, press F3.
Sprite-0004
  1. Set the colors scatter. The minimum spread is 0 and the maximum is 254.
Sprite-0005
  1. Select the action that will happen when detect color:
  • F4: Move the cursor to the location of the detected color.

  • F5: Press the button you specified.

  • F6: Move the cursor to the location of the detected color and press the button you specified.

    • If you selected: F5 or F6 actions (which use keystroke simulation), the next key you press (except F1 - F12) will become the key for simulation.
Sprite-0002
  1. Set the scan frequency (in seconds). Minimum frequency is 0.01.

  2. Press F7 to start/stop scanning. Press F8 to hide/show the program. Press F9 to stop the program (F1–F9 keystrokes are constantly monitored. You can start/stop scanning (and all other F1–F8 key actions) even if the program is not in focus or show.).

ColorSearch

Examples of use

  • Automation in games or apps: Automatically perform a click or key press when a specific color appears on the screen—useful for fast or repetitive visual cues.

  • Visual notifications: Set the program to react when a visual indicator (color) appears—trigger actions such as cursor movement or button press automatically.

Troubleshooting

When you close the program you should hear a sound, otherwise make sure the program is not in Tack Manager->Processes. If an error occurs while working in the application (for example: Error: Failed to install key hook.)

  • Try running the application as an administrator.

  • Add the program to the exceptions of the antivirus or antivirus software.

Security and legal

This tool uses low-level interception and emulation of keyboard and mouse input. Using it with third-party software (including games) may result in blocking. The author is not responsible for the illegal or incorrect use of the program.

Contribute

  • Found a bug or want a new feature? Let me know via Issues.

Download