Hi,
I was wondering how I can get the coordinates of a specific color from a window? Is it possible.
I did some research, but I only found to get a color from coordinates, but I need it the other way around.
Atm I have this, I don't know if it is right, cause I usually program in java.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace ConsoleApplication2
{
class Program
{
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll", EntryPoint = "GetDC")]
public static extern IntPtr GetDC(IntPtr ptr);
static void Main(string[] args)
{
IntPtr nWnd = FindWindow("","DutchLeader - Uitnodigingen - Windows Internet Explorer");
if (nWnd != IntPtr.Zero)
{
IntPtr dcWindow = GetDC(nWnd);
//Here should come the code to get the coordinates from the color pixel
}
else
{
Console.WriteLine("Window niet gevonden");
}
}
}
}
The second problem is that he can't findow the window. The window he needs to get, can be seen in photo which is in attachment.
Grtz